pub enum IncomingEvent {
NewMessage(Message),
Updated {
target_id: String,
message: Message,
edit_event: Option<Box<StoredEvent>>,
},
Removed {
target_id: String,
},
ReactionRemoved {
message_id: String,
reaction_id: String,
message: Message,
},
Presence {
npub: String,
joined: bool,
event_id: String,
created_at: u64,
invited_by: Option<String>,
invited_label: Option<String>,
},
Kicked {
community_id: String,
},
SelfLeft {
community_id: String,
},
WebxdcPeer {
npub: String,
topic_id: String,
node_addr: Option<String>,
event_id: String,
created_at: u64,
},
Typing {
npub: String,
until: u64,
},
}Expand description
The result of processing an inbound wire event: a brand-new message (3300), an update to
an existing message (a reaction 3301 / edit 3302 applied to its target), or a tombstone
(a delete 3305 that removed its target). New/Updated surface as a UI message_new /
message_update; Removed surfaces as a message_removed.
Variants§
NewMessage(Message)
Updated
An existing message changed (reaction or edit). message is the live-updated view for the
UI. edit_event is Some only for edits: the MESSAGE_EDIT StoredEvent the caller persists
(event-sourced, folded on reload like DM edits) instead of overwriting the row. Reactions
leave it None and the caller re-saves the message row (which carries the new reaction).
Removed
ReactionRemoved
A reaction was revoked by its author (a 3305 tombstone whose target is a reaction id).
The caller drops the reaction’s kind-7 row and re-emits message so chips refresh live.
Distinct from Removed (whole message) and Updated (re-saves the row, which is additive
and so can’t express a removal). message_id is the parent for the UI update.
Presence
A join/leave presence announcement (kind 3306). npub is the announcing member; the
caller persists + surfaces it as a MemberJoined/MemberLeft system event. event_id
is the inner id (dedup key). created_at is the inner’s authenticated timestamp (secs) so a
HISTORICALLY-synced join/leave lands at the right place in the timeline, not at ingest-time
“now”. invited_by/invited_label carry attribution on an invite-join (who/which-link
brought them) — None for a plain join/leave. Not a message.
Fields
Kicked
A cooperative kick (3309) targeting THE LOCAL USER, authorized (signer held KICK + outranked
us). The caller performs the self-removal teardown (wipe local chat data, RETAIN the held
epoch keys). A kick of ANOTHER member surfaces as Presence { joined: false }
instead, so it falls out of the observed member list without a dedicated arm.
SelfLeft
A voluntary leave-presence (3306, content “leave”) whose inner author IS the local npub — i.e. a
leave I (or another of my devices) published. route to the same self-removal teardown as
Kicked/ban so a leave on device A tears the community down on device B too. Safe because the
presence inner is real-npub-signed (only my own devices can author a leave for my npub). The
teardown is idempotent, so the publishing device tearing down on its own echoed leave is a no-op.
WebxdcPeer
A WebXDC realtime peer signal (3310): a member advertising their Iroh node for a Mini App
session (node_addr = Some) or announcing they stopped playing (node_addr = None). The
caller persists it (kind-30078 row keyed by topic_id, the DM-parity shape) and — when a
realtime channel for the topic is live — feeds the peer to the gossip layer. Not a message.
Fields
Typing
A typing indicator (3311): a member is composing in this channel. Ephemeral — never persisted
or folded; the caller feeds it to the live typing tracker and emits typing-update. until is
the unix-secs the typer should stop being shown as active (receiver-computed, ~30s out).
Auto Trait Implementations§
impl Freeze for IncomingEvent
impl RefUnwindSafe for IncomingEvent
impl Send for IncomingEvent
impl Sync for IncomingEvent
impl Unpin for IncomingEvent
impl UnsafeUnpin for IncomingEvent
impl UnwindSafe for IncomingEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more