cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 1 | use ruma::{OwnedEventId, OwnedRoomId, OwnedUserId}; |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 2 | #[cfg(feature = "serde")] |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 3 | use serde::{Deserialize, Serialize}; |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 4 | |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 5 | use crate::{EventContext, TimelineItem}; |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 6 | |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 7 | #[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 8 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 9 | pub struct MentionKey { |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 10 | pub room_id: OwnedRoomId, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 11 | pub event_id: OwnedEventId, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 12 | } |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 13 | |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 14 | #[derive(Clone, Debug, Eq, PartialEq)] |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 15 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 16 | pub enum MentionReason { |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 17 | Direct, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 18 | Reply, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 19 | Room, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 20 | } |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 21 | |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 22 | #[derive(Clone, Debug, Eq, PartialEq)] |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 23 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 24 | pub enum MentionCaptureState { |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 25 | Pending, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 26 | Partial, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 27 | Ready, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 28 | Unavailable, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 29 | Failed { message: String, retry_at_ms: u64 }, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 30 | } |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 31 | |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 32 | #[derive(Clone, Debug, Eq, PartialEq)] |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 33 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 34 | pub struct MentionEntry { |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 35 | pub key: MentionKey, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 36 | pub timestamp_ms: u64, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 37 | pub discovered_at_ms: u64, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 38 | pub discovery_revision: u64, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 39 | pub revision: u64, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 40 | pub event: TimelineItem, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 41 | pub reasons: Vec<MentionReason>, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 42 | pub read: bool, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 43 | pub capture: MentionCaptureState, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 44 | pub room_name: Option<String>, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 45 | pub notification_suppressed: bool, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 46 | } |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 47 | |
7cdaa86b9489 | atagen | 2026-10-25 08:43 UTC | 48 | #[derive(Clone, Debug, Default, Eq, PartialEq)] |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 49 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 50 | pub struct MentionCoverage { |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 51 | pub earliest_timestamp_ms: Option<u64>, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 52 | pub historical_supported: Option<bool>, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 53 | pub recovering: bool, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 54 | pub gaps: Vec<MentionGap>, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 55 | pub truncated: bool, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 56 | pub unresolved_candidates: usize, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 57 | } |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 58 | |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 59 | #[derive(Clone, Debug, Eq, PartialEq)] |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 60 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 61 | pub struct MentionGap { |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 62 | pub room_id: Option<OwnedRoomId>, |
7cdaa86b9489 | atagen | 2026-10-25 08:43 UTC | 63 | pub reason: MentionGapReason, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 64 | pub token: Option<String>, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 65 | } |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 66 | |
7cdaa86b9489 | atagen | 2026-10-25 08:43 UTC | 67 | #[derive(Clone, Copy, Debug, Eq, PartialEq)] |
7cdaa86b9489 | atagen | 2026-10-25 08:43 UTC | 68 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
7cdaa86b9489 | atagen | 2026-10-25 08:43 UTC | 69 | pub enum MentionGapReason { |
7cdaa86b9489 | atagen | 2026-10-25 08:43 UTC | 70 | SyncDiscontinuity, |
7cdaa86b9489 | atagen | 2026-10-25 08:43 UTC | 71 | /// an already observed room came back limited, `token` is its `prev_batch` |
7cdaa86b9489 | atagen | 2026-10-25 08:43 UTC | 72 | LimitedTimeline, |
7cdaa86b9489 | atagen | 2026-10-25 08:43 UTC | 73 | RoomLeft, |
7cdaa86b9489 | atagen | 2026-10-25 08:43 UTC | 74 | ContextUnavailable, |
7cdaa86b9489 | atagen | 2026-10-25 08:43 UTC | 75 | NotificationHistoryUnavailable, |
7cdaa86b9489 | atagen | 2026-10-25 08:43 UTC | 76 | /// a candidate stayed undecryptable or unresolved for a week and was dropped |
7cdaa86b9489 | atagen | 2026-10-25 08:43 UTC | 77 | CandidateExpired, |
7cdaa86b9489 | atagen | 2026-10-25 08:43 UTC | 78 | StoreReset, |
7cdaa86b9489 | atagen | 2026-10-25 08:43 UTC | 79 | /// a write failed, the inbox carries on in memory and a restart loses the unwritten part |
7cdaa86b9489 | atagen | 2026-10-25 08:43 UTC | 80 | StoreFailed, |
7cdaa86b9489 | atagen | 2026-10-25 08:43 UTC | 81 | HookTimedOut, |
7cdaa86b9489 | atagen | 2026-10-25 08:43 UTC | 82 | } |
7cdaa86b9489 | atagen | 2026-10-25 08:43 UTC | 83 | |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 84 | #[derive(Clone, Debug, Eq, PartialEq)] |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 85 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 86 | pub struct MentionsBoundary { |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 87 | pub account: OwnedUserId, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 88 | pub revision: u64, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 89 | } |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 90 | |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 91 | #[derive(Clone, Debug, Eq, PartialEq)] |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 92 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 93 | pub struct MentionsPage { |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 94 | pub entries: Vec<MentionEntry>, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 95 | pub next_cursor: Option<String>, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 96 | pub end_reached: bool, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 97 | pub coverage: MentionCoverage, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 98 | pub unread_count: usize, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 99 | pub revision: u64, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 100 | pub boundary: MentionsBoundary, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 101 | } |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 102 | |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 103 | #[derive(Clone, Debug, Eq, PartialEq)] |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 104 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 105 | pub struct SavedMentionContext { |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 106 | pub key: MentionKey, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 107 | pub state: MentionCaptureState, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 108 | pub context: Option<EventContext>, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 109 | pub revision: u64, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 110 | } |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 111 | |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 112 | #[derive(Clone, Debug, Eq, PartialEq)] |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 113 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 114 | pub struct MentionsUpdate { |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 115 | pub snapshot: MentionsPage, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 116 | pub upserts: Vec<MentionEntry>, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 117 | pub removed: Vec<MentionKey>, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 118 | } |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 119 | |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 120 | #[derive(Clone, Debug, Eq, PartialEq)] |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 121 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
7cdaa86b9489 | atagen | 2026-10-25 08:43 UTC | 122 | #[non_exhaustive] |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 123 | pub enum MentionsCommand { |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 124 | Page { cursor: Option<String>, limit: u16 }, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 125 | Context(MentionKey), |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 126 | RetryContext(MentionKey), |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 127 | SetRead { keys: Vec<MentionKey>, read: bool }, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 128 | ReadThrough(MentionsBoundary), |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 129 | Recover, |
cbb715e11963 | atagen | 2026-10-24 23:24 UTC | 130 | } |