MessageReceiver

MessageReceiver

Primary interface for handling incoming messages. User interaction is primarily performed via event listeners.

Extends

Methods

(async, static) factory() → {MessageReceiver}

Source:
Build a default instance.
Returns:
Type
MessageReceiver

addEventListener(eventName, callback)

Source:
Inherited From:
Parameters:
Name Type Description
eventName string
callback module:eventing~EventTarget~listenerCallback

close()

Source:
Perform a shutdown of the websocket.

(async) connect()

Source:
Place the receiver into the connected state. Once issued the receiver will maintain the connection until stop is called.

(async) drain()

Source:
Pop messages directly from the messages API until it's empty.

removeEventListener(eventName, callback)

Source:
Inherited From:
Parameters:
Name Type Description
eventName string
callback module:eventing~EventTarget~listenerCallback

Events

error

Source:
Properties:
Name Type Description
error Error
Type:

keychange

Source:
Type:

message

Source:
Properties:
Name Type Description
data Object
Properties
Name Type Description
timestamp number The senders sent timestamp. Warning, this is subject to clock skew; Only use for cross referencing.
source string The user UUID of the sender.
sourceDevice number The device ID of the sender.
message message The raw data message. See exchange instead.
exchange module:exchange~Exchange The recommended object for message/thread interaction.
keyChange boolean True if a keychange was detected and accepted.
New incoming message event from peer. Does not include messages sent by your other devices. Use the sent event for that.
Type:

receipt

Source:
Properties:
Name Type Description
proto Object The message envelope.
Delivery receipt from from the signal server.
Type:

sent

Source:
Properties:
Name Type Description
data Object
Properties
Name Type Description
timestamp number The senders sent timestamp. Warning, this is subject to clock skew; Only use for cross referencing.
source string The user UUID of the sender (You).
sourceDevice number The device ID of the sender (Your other device).
message message The raw data message. See exchange instead.
destination destination The thread UUID this message was sent to.
exchange module:exchange~Exchange The recommended object for message/thread interaction.
New outgoing message event from one of your devices.
Type: