Skip to main content

IncomingEvent

Enum IncomingEvent 

Source
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).

Fields

§target_id: String
§message: Message
§edit_event: Option<Box<StoredEvent>>
§

Removed

Fields

§target_id: String
§

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.

Fields

§message_id: String
§reaction_id: String
§message: Message
§

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

§npub: String
§joined: bool
§event_id: String
§created_at: u64
§invited_by: Option<String>
§invited_label: Option<String>
§

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.

Fields

§community_id: String
§

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.

Fields

§community_id: String
§

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

§npub: String
§topic_id: String
§node_addr: Option<String>

Base32 iroh node address — Some for an advertisement, None for peer-left.

§event_id: String
§created_at: u64
§

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).

Fields

§npub: String
§until: u64

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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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