pub enum ChatEvent {
Message {
opened: OpenedStream,
reply_to: Option<ReplyRef>,
emoji: Vec<(String, String)>,
},
Reaction {
opened: OpenedStream,
target: [u8; 32],
target_author: PublicKey,
emoji: String,
emoji_url: Option<String>,
},
Delete {
opened: OpenedStream,
target: [u8; 32],
target_kind: Option<u16>,
},
Edit {
opened: OpenedStream,
target: [u8; 32],
new_content: String,
},
Webxdc {
opened: OpenedStream,
},
Typing {
opened: OpenedStream,
},
}Expand description
A fully verified, typed chat event. Every variant keeps its
OpenedStream — the proven author, rumor id, and ms time live there.
Variants§
Message
Kind 9 (message; reply_to = its q inline quote) or kind 1111
(threaded reply; reply_to = its immediate parent, the lowercase e).
Text lives in opened.rumor.content; emoji is the NIP-30
(shortcode, url) pairs (attachments ride the rumor’s imeta tags).
opened.rumor.kind distinguishes the two when a caller needs to.
Reaction
Kind 7 — emoji is the reaction content; emoji_url the NIP-30 image
when the content is a custom :shortcode:.
Delete
Kind 5 — authorization (self, or a moderator) is the fold’s job, not the envelope’s.
Edit
Kind 3302 — author-only validity is likewise judged at fold time.
Webxdc
Kind 3310 — payload opaque, read opened.rumor directly.
Fields
opened: OpenedStreamTyping
Kind 23311 — the event’s presence is the whole signal.
Fields
opened: OpenedStreamImplementations§
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ChatEvent
impl RefUnwindSafe for ChatEvent
impl Send for ChatEvent
impl Sync for ChatEvent
impl Unpin for ChatEvent
impl UnsafeUnpin for ChatEvent
impl UnwindSafe for ChatEvent
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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