OutgoingMessage

OutgoingMessage

An event bus for activity related to outgoing messages. These objects are created and returned from the MessageSender. Typical interfacing is done via event listeners.

Constructor

new OutgoingMessage()

Source:
Properties:
Name Type Description
message Object The message protocol buffer.
timestamp number The offical sent timestamp for this message.
sent Array.<OutgoingMessage#sent> Array of OutgoingMessage#sent events.
errors Array.<OutgoingMessage#errors> Array of OutgoingMessage#errors events.
created number Creation timestamp.
Fires:

Methods

on(event, callback)

Source:
Add event listener.
Parameters:
Name Type Description
event string
callback function

(async) sendToAddr(encodedAddr)

Source:
Send this message to a specific peer or even a specific device of a given peer if the encodedAddr param is fully qualified.
Parameters:
Name Type Description
encodedAddr EncodedUserAddress

Events

error

Source:
Properties:
Name Type Description
timestamp number
error Error
An error occured while attempting send to a specific peer.

keychange

Source:
A peers identity key has changed.

sent

Source:
Properties:
Name Type Description
timestamp number
addr EncodedUserAddress
Event indicating that a message was successfully sent to a specific peer. Note that this does not indicate the peer has read or even receieved the message, but instead that the server has indicated that it will enqueue this message for delivery to them.