Skip to main content

OutboundEvent

Enum OutboundEvent 

Source
#[non_exhaustive]
pub enum OutboundEvent { NewMessage { chat_id: Id, message_id: Id, sender_msg_id: Id, }, Retract { chat_id: Id, message_id: Id, sender_msg_id: Id, }, Edit { chat_id: Id, message_id: Id, sender_msg_id: Id, }, ReactionUpdate { chat_id: Id, message_id: Id, sender_msg_id: Id, sender_reaction_id: String, action: ReactionAction, }, GroupUpdate { chat_id: Id, action: GroupUpdateAction, recipients: Vec<Id>, }, Receipt { chat_id: Id, message_id: Id, sender_msg_id: Id, sender_id: Id, read_at: UTCDate, read_disposition: Option<ReadDisposition>, }, Typing { chat_id: Id, typing: bool, }, Presence, }
Expand description

One outbound event the Message/set, Chat/set, Chat/typing or PresenceStatus/set handler reports.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

NewMessage

The owner created a Message. draft-atwood-jmap-chat-00 §Message/set: the server sets the server-assigned fields “then enqueues the message for outbound delivery” (Peer/deliver message). Reported after the Message is written; the payload fields are read from the stored Message.

Fields

§chat_id: Id

The Chat that holds the Message (Peer/deliver chatId).

§message_id: Id

The Message’s local id.

§sender_msg_id: Id

The Message’s senderMsgId (message.senderMsgId).

§

Retract

The owner set deletedForAll: true on a Message they sent. draft-atwood-jmap-chat-federation-00 §Peer/retract “Sender Behavior”: “the server MUST send Peer/retract to the server of every other participant in the Chat.” Reported after the update is written; the payload fields are read from the stored Message before the update.

Fields

§chat_id: Id

The Chat that holds the Message (Peer/retract chatId).

§message_id: Id

The Message’s local id.

§sender_msg_id: Id

The Message’s senderMsgId (Peer/retract senderMsgId).

§

Edit

The owner edited a Message’s body, bodyType, mentions or broadcastMentions. draft-atwood-jmap-chat-00 §Editing a Message: “Send Peer/deliver carrying an edit payload to all recipients”. Reported after the edit is written; the payload fields are read from the stored Message.

Fields

§chat_id: Id

The Chat that holds the Message (Peer/deliver chatId).

§message_id: Id

The Message’s local id.

§sender_msg_id: Id

The Message’s senderMsgId (edit.senderMsgId).

§

ReactionUpdate

The owner added or removed one of their reactions on a Message. draft-atwood-jmap-chat-00 §Adding and Removing Reactions: the server “MUST propagate the reaction to all recipients via Peer/deliver reactionUpdate payload, carrying the senderReactionId as the map key”, and a removal “using the same senderReactionId”. Reported after the update is written, one event per reactions/<senderReactionId> patch key.

Fields

§chat_id: Id

The Chat that holds the Message (Peer/deliver chatId).

§message_id: Id

The Message’s local id.

§sender_msg_id: Id

The Message’s senderMsgId (reactionUpdate.senderMsgId).

§sender_reaction_id: String

The reactions map key (reactionUpdate.senderReactionId).

§action: ReactionAction

reactionUpdate.action.

§

GroupUpdate

A group Chat was created or changed (Peer/groupUpdate), reported after the change is written.

Fields

§chat_id: Id

The group Chat (Peer/groupUpdate chatId).

§action: GroupUpdateAction

What changed (Peer/groupUpdate action).

§recipients: Vec<Id>

ChatContact ids of the members to notify, per draft-atwood-jmap-chat-00 §Chat/set (see each GroupUpdateAction variant). Never contains the accountId.

§

Receipt

The owner set a non-null readAt on a Message another participant sent. draft-atwood-jmap-chat-federation-00 §Peer/receipt: readAt “SHOULD be present when the recipient’s owner has read the message”. Reported after the update is written, and only when the owner’s effective receipt-sharing preference is true: “If the effective preference is false, the server SHOULD NOT invoke Peer/receipt” (§Peer/receipt “Sender Behavior”). The read fields and the sender are carried here because a burnOnRead Message is gone once read.

Fields

§chat_id: Id

The Chat that holds the Message.

§message_id: Id

The Message’s local id. Under burnOnRead the Message has been hard-deleted by the time the event is reported.

§sender_msg_id: Id

The Message’s senderMsgId (Peer/receipt senderMsgId).

§sender_id: Id

The Message’s senderId: the ChatContact id of its original sender, whose identity is the Peer/receipt recipientUserId (“the message’s original sender”).

§read_at: UTCDate

Peer/receipt readAt.

§read_disposition: Option<ReadDisposition>

Peer/receipt readDisposition, as stored: "displayed" when the patch set readAt without it.

§

Typing

The owner called Chat/typing. draft-atwood-jmap-chat-00 §Chat/typing: the server SHOULD deliver a typing push event to each local participant other than the owner and, “For federated Chats, the server SHOULD invoke Peer/typing” on each remote participant’s home server. Reported after the request is validated; the event is never stored. The per-recipient checks belong to the receiving side (see should_deliver_typing).

Fields

§chat_id: Id

The Chat (Peer/typing chatId).

§typing: bool

Peer/typing typing.

§

Presence

The owner changed presence, statusText or statusEmoji. draft-atwood-jmap-chat-federation-00 §Peer/subscribePresence (jmap-chat-spec b1cd625 L1049): the server “MAY push subsequent Peer/presence calls to the subscriber whenever the subscribed user’s presence, statusText, or statusEmoji changes; each carries the subscribed user’s identity in identity and the subscriberId in recipientUserId”. Here the subscribed user is the owner, so each push sends the owner’s ownerUserId as identity and one subscriber as recipientUserId. Reported after a PresenceStatus/set update that names any of the three is written; the payload is read from the stored PresenceStatus, and the subscribers are the backend’s.

Trait Implementations§

Source§

impl Clone for OutboundEvent

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for OutboundEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for OutboundEvent

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for OutboundEvent

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more