96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1 | use std::{fmt, sync::Arc}; |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 2 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 3 | use ruma::{ |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 4 | OwnedDeviceId, OwnedEventId, OwnedMxcUri, OwnedRoomAliasId, OwnedRoomId, OwnedRoomOrAliasId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 5 | OwnedServerName, OwnedTransactionId, OwnedUserId, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 6 | events::{ |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 7 | AnyGlobalAccountDataEventContent, AnyRoomAccountDataEventContent, AnySyncTimelineEvent, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 8 | GlobalAccountDataEventType, RoomAccountDataEventType, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 9 | room::member::StrippedRoomMemberEvent, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 10 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 11 | serde::Raw, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 12 | }; |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 13 | #[cfg(feature = "serde")] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 14 | use serde::{Deserialize, Serialize}; |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 15 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 16 | /// every command answers exactly once through `ClientHandle::send` or `execute`. |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 17 | /// the event stream only ever carries state |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 18 | #[derive(Debug)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 19 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 20 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 21 | pub enum Command { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 22 | Account(AccountCommand), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 23 | Room(RoomCommand), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 24 | Timeline(TimelineCommand), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 25 | Media(MediaCommand), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 26 | Encryption(EncryptionCommand), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 27 | Notification(NotificationCommand), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 28 | Lifecycle(LifecycleCommand), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 29 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 30 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 31 | #[derive(Debug)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 32 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 33 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 34 | pub enum AccountCommand { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 35 | Logout, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 36 | SetAccountData { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 37 | event_type: GlobalAccountDataEventType, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 38 | content: Raw<AnyGlobalAccountDataEventContent>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 39 | }, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 40 | SetDisplayName(Option<String>), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 41 | SetAvatar(Option<OwnedMxcUri>), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 42 | /// uploads the image and points the profile at it, same byte cap as any upload |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 43 | UploadAvatar { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 44 | mimetype: String, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 45 | bytes: Vec<u8>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 46 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 47 | RenameDevice { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 48 | device_id: OwnedDeviceId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 49 | display_name: String, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 50 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 51 | DeleteDevices { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 52 | device_ids: Vec<OwnedDeviceId>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 53 | auth: Option<crate::InteractiveAuth>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 54 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 55 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 56 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 57 | #[derive(Clone, Debug)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 58 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 59 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 60 | pub enum RoomCommand { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 61 | /// the snapshot turns up as `Event::TimelineReset`. opening an open room sends a fresh one |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 62 | Open(OwnedRoomId), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 63 | Close(OwnedRoomId), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 64 | Join { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 65 | room: OwnedRoomOrAliasId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 66 | via: Vec<OwnedServerName>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 67 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 68 | Leave(OwnedRoomId), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 69 | Forget(OwnedRoomId), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 70 | AcceptInvite(OwnedRoomId), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 71 | RejectInvite(OwnedRoomId), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 72 | InviteUser { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 73 | room_id: OwnedRoomId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 74 | user_id: OwnedUserId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 75 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 76 | KickUser { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 77 | room_id: OwnedRoomId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 78 | user_id: OwnedUserId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 79 | reason: Option<String>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 80 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 81 | BanUser { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 82 | room_id: OwnedRoomId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 83 | user_id: OwnedUserId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 84 | reason: Option<String>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 85 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 86 | UnbanUser { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 87 | room_id: OwnedRoomId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 88 | user_id: OwnedUserId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 89 | reason: Option<String>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 90 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 91 | SetPowerLevels { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 92 | room_id: OwnedRoomId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 93 | changes: PowerLevelChanges, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 94 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 95 | SetUserPowerLevel { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 96 | room_id: OwnedRoomId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 97 | user_id: OwnedUserId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 98 | level: i64, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 99 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 100 | Create(CreateRoomOptions), |
fa9114fcf75f | atagen | 2026-09-24 12:51 UTC | 101 | /// hands back the existing dm if there is one |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 102 | CreateDirect(OwnedUserId), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 103 | CancelSend { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 104 | room_id: OwnedRoomId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 105 | transaction_id: OwnedTransactionId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 106 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 107 | RetrySend { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 108 | room_id: OwnedRoomId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 109 | transaction_id: OwnedTransactionId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 110 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 111 | SetTyping { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 112 | room_id: OwnedRoomId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 113 | typing: bool, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 114 | }, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 115 | SetAccountData { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 116 | room_id: OwnedRoomId, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 117 | event_type: RoomAccountDataEventType, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 118 | content: Raw<AnyRoomAccountDataEventContent>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 119 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 120 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 121 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 122 | #[derive(Clone, Debug, Default, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 123 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 124 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 125 | pub struct CreateRoomOptions { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 126 | pub name: Option<String>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 127 | pub topic: Option<String>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 128 | pub alias_localpart: Option<String>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 129 | pub invite: Vec<OwnedUserId>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 130 | pub direct: bool, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 131 | pub visibility: RoomVisibility, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 132 | pub preset: Option<RoomPreset>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 133 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 134 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 135 | impl CreateRoomOptions { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 136 | #[must_use] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 137 | pub fn with_name(mut self, name: impl Into<String>) -> Self { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 138 | self.name = Some(name.into()); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 139 | self |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 140 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 141 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 142 | #[must_use] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 143 | pub fn with_topic(mut self, topic: impl Into<String>) -> Self { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 144 | self.topic = Some(topic.into()); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 145 | self |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 146 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 147 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 148 | #[must_use] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 149 | pub fn with_alias_localpart(mut self, localpart: impl Into<String>) -> Self { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 150 | self.alias_localpart = Some(localpart.into()); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 151 | self |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 152 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 153 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 154 | #[must_use] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 155 | pub fn with_invite(mut self, invite: impl IntoIterator<Item = OwnedUserId>) -> Self { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 156 | self.invite = invite.into_iter().collect(); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 157 | self |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 158 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 159 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 160 | #[must_use] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 161 | pub const fn with_direct(mut self, direct: bool) -> Self { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 162 | self.direct = direct; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 163 | self |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 164 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 165 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 166 | #[must_use] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 167 | pub const fn with_visibility(mut self, visibility: RoomVisibility) -> Self { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 168 | self.visibility = visibility; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 169 | self |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 170 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 171 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 172 | #[must_use] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 173 | pub const fn with_preset(mut self, preset: RoomPreset) -> Self { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 174 | self.preset = Some(preset); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 175 | self |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 176 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 177 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 178 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 179 | #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 180 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 181 | pub enum RoomVisibility { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 182 | #[default] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 183 | Private, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 184 | Public, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 185 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 186 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 187 | #[derive(Clone, Copy, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 188 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 189 | pub enum RoomPreset { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 190 | PrivateChat, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 191 | TrustedPrivateChat, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 192 | PublicChat, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 193 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 194 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 195 | #[derive(Clone, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 196 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 197 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 198 | pub enum TimelineCommand { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 199 | OpenThread { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 200 | room_id: OwnedRoomId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 201 | root_event_id: OwnedEventId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 202 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 203 | CloseThread { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 204 | room_id: OwnedRoomId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 205 | root_event_id: OwnedEventId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 206 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 207 | /// Re-emit an authoritative reset for an open room or thread without |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 208 | /// closing it. The reset arrives before this command's terminal result. |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 209 | Resync { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 210 | timeline_id: TimelineId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 211 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 212 | Paginate { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 213 | timeline_id: TimelineId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 214 | limit: u16, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 215 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 216 | Send { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 217 | timeline_id: TimelineId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 218 | content: MessageContent, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 219 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 220 | Edit { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 221 | timeline_id: TimelineId, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 222 | target: EventRef, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 223 | content: MessageEditContent, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 224 | }, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 225 | /// redacting your own unsent message just cancels it |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 226 | Redact { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 227 | timeline_id: TimelineId, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 228 | target: EventRef, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 229 | reason: Option<String>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 230 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 231 | ToggleReaction { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 232 | timeline_id: TimelineId, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 233 | target: EventRef, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 234 | key: String, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 235 | }, |
fa9114fcf75f | atagen | 2026-09-24 12:51 UTC | 236 | /// works on a closed room too, it just can't refuse to move the marker backwards |
fa9114fcf75f | atagen | 2026-09-24 12:51 UTC | 237 | MarkRead { |
fa9114fcf75f | atagen | 2026-09-24 12:51 UTC | 238 | timeline_id: TimelineId, |
fa9114fcf75f | atagen | 2026-09-24 12:51 UTC | 239 | event_id: OwnedEventId, |
fa9114fcf75f | atagen | 2026-09-24 12:51 UTC | 240 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 241 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 242 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 243 | impl TimelineCommand { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 244 | #[must_use] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 245 | pub const fn room_id(&self) -> &OwnedRoomId { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 246 | match self { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 247 | Self::OpenThread { room_id, .. } | Self::CloseThread { room_id, .. } => room_id, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 248 | Self::Resync { timeline_id } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 249 | | Self::Paginate { timeline_id, .. } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 250 | | Self::Send { timeline_id, .. } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 251 | | Self::Edit { timeline_id, .. } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 252 | | Self::Redact { timeline_id, .. } |
fa9114fcf75f | atagen | 2026-09-24 12:51 UTC | 253 | | Self::ToggleReaction { timeline_id, .. } |
fa9114fcf75f | atagen | 2026-09-24 12:51 UTC | 254 | | Self::MarkRead { timeline_id, .. } => timeline_id.room_id(), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 255 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 256 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 257 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 258 | #[must_use] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 259 | pub const fn timeline_id(&self) -> Option<&TimelineId> { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 260 | match self { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 261 | Self::OpenThread { .. } | Self::CloseThread { .. } => None, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 262 | Self::Resync { timeline_id } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 263 | | Self::Paginate { timeline_id, .. } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 264 | | Self::Send { timeline_id, .. } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 265 | | Self::Edit { timeline_id, .. } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 266 | | Self::Redact { timeline_id, .. } |
fa9114fcf75f | atagen | 2026-09-24 12:51 UTC | 267 | | Self::ToggleReaction { timeline_id, .. } |
fa9114fcf75f | atagen | 2026-09-24 12:51 UTC | 268 | | Self::MarkRead { timeline_id, .. } => Some(timeline_id), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 269 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 270 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 271 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 272 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 273 | #[derive(Clone, Debug, Eq, Hash, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 274 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 275 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 276 | pub enum TimelineId { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 277 | Room(OwnedRoomId), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 278 | Thread { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 279 | room_id: OwnedRoomId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 280 | root_event_id: OwnedEventId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 281 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 282 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 283 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 284 | impl TimelineId { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 285 | #[must_use] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 286 | pub const fn room_id(&self) -> &OwnedRoomId { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 287 | match self { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 288 | Self::Room(room_id) | Self::Thread { room_id, .. } => room_id, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 289 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 290 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 291 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 292 | #[must_use] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 293 | pub fn thread(room_id: OwnedRoomId, root_event_id: OwnedEventId) -> Self { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 294 | Self::Thread { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 295 | room_id, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 296 | root_event_id, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 297 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 298 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 299 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 300 | #[must_use] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 301 | pub fn thread_root(&self) -> Option<&OwnedEventId> { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 302 | match self { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 303 | Self::Room(_) => None, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 304 | Self::Thread { root_event_id, .. } => Some(root_event_id), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 305 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 306 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 307 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 308 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 309 | impl From<OwnedRoomId> for TimelineId { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 310 | fn from(room_id: OwnedRoomId) -> Self { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 311 | Self::Room(room_id) |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 312 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 313 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 314 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 315 | #[derive(Clone, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 316 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 317 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 318 | pub enum MediaCommand { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 319 | /// succeeds once the send queue has it. progress and failure arrive as events |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 320 | Upload(AttachmentUpload), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 321 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 322 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 323 | #[derive(Clone, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 324 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 325 | pub struct AttachmentUpload { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 326 | pub timeline_id: TimelineId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 327 | pub filename: String, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 328 | pub mimetype: String, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 329 | pub bytes: Vec<u8>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 330 | pub caption: Option<String>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 331 | pub details: Option<UploadDetails>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 332 | pub thumbnail: Option<UploadThumbnail>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 333 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 334 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 335 | impl AttachmentUpload { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 336 | #[must_use] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 337 | pub fn new( |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 338 | timeline_id: impl Into<TimelineId>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 339 | filename: impl Into<String>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 340 | mimetype: impl Into<String>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 341 | bytes: Vec<u8>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 342 | ) -> Self { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 343 | Self { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 344 | timeline_id: timeline_id.into(), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 345 | filename: filename.into(), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 346 | mimetype: mimetype.into(), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 347 | bytes, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 348 | caption: None, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 349 | details: None, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 350 | thumbnail: None, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 351 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 352 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 353 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 354 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 355 | #[derive(Clone, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 356 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 357 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 358 | pub enum UploadDetails { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 359 | Image { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 360 | width: Option<u32>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 361 | height: Option<u32>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 362 | blurhash: Option<String>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 363 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 364 | Video { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 365 | width: Option<u32>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 366 | height: Option<u32>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 367 | duration_ms: Option<u64>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 368 | blurhash: Option<String>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 369 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 370 | Audio { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 371 | duration_ms: Option<u64>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 372 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 373 | Voice { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 374 | duration_ms: u64, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 375 | waveform: Vec<u16>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 376 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 377 | File, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 378 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 379 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 380 | #[derive(Clone, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 381 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 382 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 383 | pub struct UploadThumbnail { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 384 | pub bytes: Vec<u8>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 385 | pub mimetype: String, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 386 | pub width: u32, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 387 | pub height: u32, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 388 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 389 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 390 | impl UploadThumbnail { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 391 | #[must_use] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 392 | pub fn new(bytes: Vec<u8>, mimetype: impl Into<String>, width: u32, height: u32) -> Self { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 393 | Self { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 394 | bytes, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 395 | mimetype: mimetype.into(), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 396 | width, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 397 | height, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 398 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 399 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 400 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 401 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 402 | #[derive(Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 403 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 404 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 405 | pub enum EncryptionCommand { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 406 | Recover(String), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 407 | CreateKeyBackup, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 408 | EnableKeyBackup, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 409 | DisableKeyBackup { delete_from_server: bool }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 410 | RecoverKeyBackup(String), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 411 | StartVerification(VerificationTarget), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 412 | Verify(VerificationAction), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 413 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 414 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 415 | impl fmt::Debug for EncryptionCommand { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 416 | fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 417 | match self { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 418 | Self::Recover(_) => formatter.debug_tuple("Recover").field(&"...").finish(), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 419 | Self::CreateKeyBackup => formatter.write_str("CreateKeyBackup"), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 420 | Self::EnableKeyBackup => formatter.write_str("EnableKeyBackup"), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 421 | Self::DisableKeyBackup { delete_from_server } => formatter |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 422 | .debug_struct("DisableKeyBackup") |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 423 | .field("delete_from_server", delete_from_server) |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 424 | .finish(), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 425 | Self::RecoverKeyBackup(_) => formatter |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 426 | .debug_tuple("RecoverKeyBackup") |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 427 | .field(&"...") |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 428 | .finish(), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 429 | Self::StartVerification(target) => formatter |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 430 | .debug_tuple("StartVerification") |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 431 | .field(target) |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 432 | .finish(), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 433 | Self::Verify(action) => formatter.debug_tuple("Verify").field(action).finish(), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 434 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 435 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 436 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 437 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 438 | #[derive(Clone, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 439 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 440 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 441 | pub enum NotificationCommand { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 442 | SetRoomMode { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 443 | room_id: OwnedRoomId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 444 | mode: RoomNotificationMode, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 445 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 446 | ResetRoomMode(OwnedRoomId), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 447 | SetDefaultMode { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 448 | encrypted: bool, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 449 | one_to_one: bool, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 450 | mode: RoomNotificationMode, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 451 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 452 | AddKeyword(String), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 453 | RemoveKeyword(String), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 454 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 455 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 456 | #[derive(Clone, Copy, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 457 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 458 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 459 | pub enum LifecycleCommand { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 460 | Shutdown, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 461 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 462 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 463 | #[derive(Clone, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 464 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 465 | #[non_exhaustive] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 466 | pub enum CommandOutput { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 467 | Done, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 468 | Room(OwnedRoomId), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 469 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 470 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 471 | #[derive(Clone, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 472 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 473 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 474 | pub enum MessageContent { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 475 | Text { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 476 | content: RichText, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 477 | mentions: MessageMentions, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 478 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 479 | Emote { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 480 | content: RichText, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 481 | mentions: MessageMentions, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 482 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 483 | Reply { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 484 | event_id: OwnedEventId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 485 | content: RichText, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 486 | mentions: MessageMentions, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 487 | notify_replied_to: bool, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 488 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 489 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 490 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 491 | impl MessageContent { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 492 | #[must_use] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 493 | pub fn text(body: impl Into<String>) -> Self { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 494 | Self::Text { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 495 | content: RichText::plain(body), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 496 | mentions: MessageMentions::default(), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 497 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 498 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 499 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 500 | #[must_use] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 501 | pub fn html(body: impl Into<String>, formatted_body: impl Into<String>) -> Self { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 502 | Self::Text { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 503 | content: RichText::html(body, formatted_body), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 504 | mentions: MessageMentions::default(), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 505 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 506 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 507 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 508 | #[must_use] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 509 | pub fn emote(content: RichText, mentions: MessageMentions) -> Self { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 510 | Self::Emote { content, mentions } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 511 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 512 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 513 | #[must_use] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 514 | pub fn reply(event_id: OwnedEventId, content: RichText, mentions: MessageMentions) -> Self { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 515 | Self::Reply { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 516 | event_id, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 517 | content, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 518 | mentions, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 519 | notify_replied_to: true, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 520 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 521 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 522 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 523 | #[must_use] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 524 | pub fn reply_without_notification( |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 525 | event_id: OwnedEventId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 526 | content: RichText, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 527 | mentions: MessageMentions, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 528 | ) -> Self { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 529 | Self::Reply { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 530 | event_id, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 531 | content, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 532 | mentions, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 533 | notify_replied_to: false, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 534 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 535 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 536 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 537 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 538 | #[derive(Clone, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 539 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 540 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 541 | pub enum MessageEditContent { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 542 | Text { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 543 | content: RichText, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 544 | mentions: MessageMentions, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 545 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 546 | Emote { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 547 | content: RichText, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 548 | mentions: MessageMentions, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 549 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 550 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 551 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 552 | impl MessageEditContent { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 553 | #[must_use] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 554 | pub fn text(body: impl Into<String>) -> Self { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 555 | Self::Text { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 556 | content: RichText::plain(body), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 557 | mentions: MessageMentions::default(), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 558 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 559 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 560 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 561 | #[must_use] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 562 | pub fn html(body: impl Into<String>, formatted_body: impl Into<String>) -> Self { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 563 | Self::Text { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 564 | content: RichText::html(body, formatted_body), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 565 | mentions: MessageMentions::default(), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 566 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 567 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 568 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 569 | #[must_use] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 570 | pub fn emote(content: RichText, mentions: MessageMentions) -> Self { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 571 | Self::Emote { content, mentions } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 572 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 573 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 574 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 575 | #[derive(Clone, Debug, Default, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 576 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 577 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 578 | pub struct RichText { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 579 | pub body: String, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 580 | pub formatted_body: Option<String>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 581 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 582 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 583 | impl RichText { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 584 | #[must_use] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 585 | pub fn plain(body: impl Into<String>) -> Self { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 586 | Self { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 587 | body: body.into(), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 588 | formatted_body: None, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 589 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 590 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 591 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 592 | #[must_use] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 593 | pub fn html(body: impl Into<String>, formatted_body: impl Into<String>) -> Self { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 594 | Self { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 595 | body: body.into(), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 596 | formatted_body: Some(formatted_body.into()), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 597 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 598 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 599 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 600 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 601 | #[derive(Clone, Debug, Default, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 602 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 603 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 604 | pub struct MessageMentions { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 605 | pub user_ids: Vec<OwnedUserId>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 606 | pub room: bool, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 607 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 608 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 609 | impl MessageMentions { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 610 | #[must_use] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 611 | pub fn with_user_ids(user_ids: impl IntoIterator<Item = OwnedUserId>) -> Self { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 612 | Self { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 613 | user_ids: user_ids.into_iter().collect(), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 614 | room: false, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 615 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 616 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 617 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 618 | #[must_use] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 619 | pub fn room() -> Self { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 620 | Self { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 621 | user_ids: Vec::new(), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 622 | room: true, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 623 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 624 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 625 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 626 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 627 | #[derive(Clone, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 628 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 629 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 630 | pub enum Event { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 631 | ConnectionChanged(ConnectionState), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 632 | Authenticated { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 633 | user_id: OwnedUserId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 634 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 635 | /// Refresh tokens changed. Persist a fresh `ClientHandle::session_record()` |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 636 | /// atomically; a record captured before this event may no longer restore. |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 637 | SessionTokensChanged, |
fa9114fcf75f | atagen | 2026-09-24 12:51 UTC | 638 | /// the server stopped honouring our token and the engine stops. on a soft |
fa9114fcf75f | atagen | 2026-09-24 12:51 UTC | 639 | /// logout keep the store and log in again with the same device, otherwise |
fa9114fcf75f | atagen | 2026-09-24 12:51 UTC | 640 | /// the record and the store are both dead |
fa9114fcf75f | atagen | 2026-09-24 12:51 UTC | 641 | SessionAccessRejected { |
fa9114fcf75f | atagen | 2026-09-24 12:51 UTC | 642 | soft_logout: bool, |
fa9114fcf75f | atagen | 2026-09-24 12:51 UTC | 643 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 644 | NotificationSettingsChanged, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 645 | VerificationTargetChanged(VerificationTarget), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 646 | RoomsChanged, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 647 | /// replaces whatever you had for this timeline. every diff after it applies to it |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 648 | TimelineReset { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 649 | timeline_id: TimelineId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 650 | items: Vec<TimelineItem>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 651 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 652 | TimelineChanged { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 653 | timeline_id: TimelineId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 654 | diffs: Vec<TimelineDiff>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 655 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 656 | HistoryChanged { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 657 | timeline_id: TimelineId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 658 | state: HistoryState, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 659 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 660 | TypingChanged(TypingState), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 661 | MediaUploadProgress { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 662 | room_id: OwnedRoomId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 663 | transaction_id: OwnedTransactionId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 664 | uploaded_bytes: u64, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 665 | total_bytes: u64, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 666 | complete: bool, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 667 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 668 | MediaUploadFailed { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 669 | room_id: OwnedRoomId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 670 | transaction_id: OwnedTransactionId, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 671 | kind: crate::ErrorKind, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 672 | recoverable: bool, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 673 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 674 | EncryptionChanged(EncryptionState), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 675 | VerificationChanged(VerificationState), |
fa9114fcf75f | atagen | 2026-09-24 12:51 UTC | 676 | /// logout went through and the engine stops. delete the record and the store |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 677 | LoggedOut, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 678 | Failed(EngineFailure), |
fa9114fcf75f | atagen | 2026-09-24 12:51 UTC | 679 | /// always the last event. keep the saved record unless `LoggedOut` or a |
fa9114fcf75f | atagen | 2026-09-24 12:51 UTC | 680 | /// hard `SessionAccessRejected` came first. commands still in flight get no result |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 681 | Stopped, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 682 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 683 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 684 | #[derive(Clone, Copy, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 685 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 686 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 687 | pub enum ConnectionState { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 688 | Idle, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 689 | Connecting, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 690 | Online, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 691 | Offline, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 692 | Stopped, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 693 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 694 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 695 | #[derive(Clone, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 696 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 697 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 698 | pub struct RoomSummary { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 699 | pub room_id: OwnedRoomId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 700 | pub name: String, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 701 | pub membership: RoomMembership, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 702 | pub unread_messages: u64, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 703 | pub unread_mentions: u64, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 704 | pub encrypted: bool, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 705 | pub space: bool, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 706 | pub direct: bool, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 707 | pub favourite: bool, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 708 | pub low_priority: bool, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 709 | pub avatar: Option<OwnedMxcUri>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 710 | pub latest_event_timestamp_ms: Option<u64>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 711 | pub latest_event: Option<LatestEvent>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 712 | pub notification_mode: Option<RoomNotificationMode>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 713 | pub notification_mode_custom: bool, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 714 | pub topic: Option<String>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 715 | pub canonical_alias: Option<OwnedRoomAliasId>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 716 | pub joined_members: u64, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 717 | pub invited_members: u64, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 718 | /// who a nameless room gets named after |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 719 | pub heroes: Vec<RoomHero>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 720 | /// set once the room has been upgraded, this is where everyone went |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 721 | pub successor: Option<OwnedRoomId>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 722 | pub inviter: Option<OwnedUserId>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 723 | /// joined spaces that list this room as a child |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 724 | pub parent_spaces: Vec<OwnedRoomId>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 725 | /// for a space, the children it lists, joined or not |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 726 | pub children: Vec<OwnedRoomId>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 727 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 728 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 729 | #[derive(Clone, Debug, Eq, PartialEq)] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 730 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 731 | #[non_exhaustive] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 732 | pub struct RoomHero { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 733 | pub user_id: OwnedUserId, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 734 | pub display_name: Option<String>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 735 | pub avatar: Option<OwnedMxcUri>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 736 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 737 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 738 | /// enough for a room list preview line. `body` is empty for anything that isn't a plain message |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 739 | #[derive(Clone, Debug, Eq, PartialEq)] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 740 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 741 | #[non_exhaustive] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 742 | pub struct LatestEvent { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 743 | pub sender: Option<OwnedUserId>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 744 | pub body: Option<String>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 745 | pub timestamp_ms: Option<u64>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 746 | pub send_state: SendState, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 747 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 748 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 749 | #[derive(Clone, Debug, Eq, PartialEq)] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 750 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 751 | #[non_exhaustive] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 752 | pub struct Profile { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 753 | pub user_id: OwnedUserId, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 754 | pub display_name: Option<String>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 755 | pub avatar: Option<OwnedMxcUri>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 756 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 757 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 758 | /// one room in a space's hierarchy, as the server describes it, which may be a room you're not in |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 759 | #[derive(Clone, Debug, Eq, PartialEq)] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 760 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 761 | #[non_exhaustive] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 762 | pub struct SpaceChild { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 763 | pub room_id: OwnedRoomId, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 764 | pub name: String, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 765 | pub topic: Option<String>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 766 | pub avatar: Option<OwnedMxcUri>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 767 | pub canonical_alias: Option<OwnedRoomAliasId>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 768 | pub joined_members: u64, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 769 | pub space: bool, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 770 | pub children_count: u64, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 771 | pub membership: Option<RoomMembership>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 772 | pub via: Vec<OwnedServerName>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 773 | pub suggested: bool, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 774 | pub world_readable: Option<bool>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 775 | pub guest_can_join: bool, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 776 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 777 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 778 | #[derive(Clone, Copy, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 779 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 780 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 781 | pub enum RoomNotificationMode { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 782 | AllMessages, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 783 | MentionsAndKeywordsOnly, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 784 | Mute, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 785 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 786 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 787 | #[derive(Clone, Copy, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 788 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 789 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 790 | pub struct RoomNotificationSettings { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 791 | pub mode: RoomNotificationMode, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 792 | pub custom: bool, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 793 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 794 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 795 | #[derive(Clone, Debug)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 796 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 797 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 798 | pub enum PushNotificationStatus { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 799 | Event(Box<PushNotification>), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 800 | NotFound, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 801 | FilteredOut, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 802 | Redacted, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 803 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 804 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 805 | #[derive(Clone, Debug)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 806 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 807 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 808 | pub struct PushNotification { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 809 | pub event_id: OwnedEventId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 810 | pub event: PushNotificationEvent, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 811 | pub sender: PushNotificationSender, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 812 | pub room: PushNotificationRoom, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 813 | pub noisy: Option<bool>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 814 | pub has_mention: Option<bool>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 815 | pub thread_id: Option<OwnedEventId>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 816 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 817 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 818 | #[derive(Clone, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 819 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 820 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 821 | pub struct PushNotificationSender { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 822 | pub user_id: OwnedUserId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 823 | pub display_name: Option<String>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 824 | pub avatar_url: Option<OwnedMxcUri>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 825 | pub name_ambiguous: bool, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 826 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 827 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 828 | #[derive(Clone, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 829 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 830 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 831 | pub struct PushNotificationRoom { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 832 | pub room_id: OwnedRoomId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 833 | pub name: String, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 834 | pub avatar_url: Option<OwnedMxcUri>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 835 | pub canonical_alias: Option<OwnedRoomAliasId>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 836 | pub topic: Option<String>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 837 | pub encrypted: Option<bool>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 838 | pub direct: bool, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 839 | pub joined_members_count: u64, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 840 | pub service_members: Vec<OwnedUserId>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 841 | pub active_service_members_count: u64, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 842 | pub space: bool, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 843 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 844 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 845 | #[derive(Clone, Debug)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 846 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 847 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 848 | pub enum PushNotificationEvent { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 849 | Timeline(Raw<AnySyncTimelineEvent>), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 850 | Invite(Raw<StrippedRoomMemberEvent>), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 851 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 852 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 853 | #[derive(Clone, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 854 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 855 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 856 | pub struct RoomPowerLevels { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 857 | pub ban: i64, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 858 | pub invite: i64, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 859 | pub kick: i64, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 860 | pub redact: i64, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 861 | pub events_default: i64, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 862 | pub state_default: i64, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 863 | pub users_default: i64, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 864 | pub room_notification: i64, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 865 | pub users: Vec<(OwnedUserId, i64)>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 866 | pub events: Vec<(String, i64)>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 867 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 868 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 869 | #[derive(Clone, Debug, Default, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 870 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 871 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 872 | pub struct PowerLevelChanges { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 873 | pub ban: Option<i64>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 874 | pub invite: Option<i64>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 875 | pub kick: Option<i64>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 876 | pub redact: Option<i64>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 877 | pub events_default: Option<i64>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 878 | pub state_default: Option<i64>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 879 | pub users_default: Option<i64>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 880 | pub room_notification: Option<i64>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 881 | pub room_name: Option<i64>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 882 | pub room_avatar: Option<i64>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 883 | pub room_topic: Option<i64>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 884 | pub space_child: Option<i64>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 885 | pub beacon: Option<i64>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 886 | pub beacon_info: Option<i64>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 887 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 888 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 889 | #[derive(Clone, Copy, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 890 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 891 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 892 | pub enum RoomMembership { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 893 | Joined, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 894 | Invited, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 895 | Left, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 896 | Knocked, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 897 | Banned, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 898 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 899 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 900 | #[derive(Clone, Debug, Default, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 901 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 902 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 903 | pub struct RoomListFilter { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 904 | pub membership: Option<RoomMembership>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 905 | pub category: Option<RoomCategory>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 906 | pub favourite: Option<bool>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 907 | pub unread_only: bool, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 908 | pub search: Option<String>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 909 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 910 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 911 | impl RoomListFilter { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 912 | #[must_use] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 913 | pub fn with_membership(mut self, membership: RoomMembership) -> Self { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 914 | self.membership = Some(membership); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 915 | self |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 916 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 917 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 918 | #[must_use] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 919 | pub fn with_category(mut self, category: RoomCategory) -> Self { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 920 | self.category = Some(category); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 921 | self |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 922 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 923 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 924 | #[must_use] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 925 | pub fn with_favourite(mut self, favourite: bool) -> Self { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 926 | self.favourite = Some(favourite); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 927 | self |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 928 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 929 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 930 | #[must_use] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 931 | pub const fn with_unread_only(mut self, unread_only: bool) -> Self { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 932 | self.unread_only = unread_only; |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 933 | self |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 934 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 935 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 936 | #[must_use] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 937 | pub fn with_search(mut self, search: impl Into<String>) -> Self { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 938 | self.search = Some(search.into()); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 939 | self |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 940 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 941 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 942 | #[must_use] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 943 | pub fn matches(&self, room: &RoomSummary) -> bool { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 944 | self.matcher().matches(room) |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 945 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 946 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 947 | /// lowercases the search once, for filtering a whole list |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 948 | #[must_use] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 949 | pub fn matcher(&self) -> RoomMatcher<'_> { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 950 | RoomMatcher { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 951 | filter: self, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 952 | search: self.search.as_deref().map(str::to_lowercase), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 953 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 954 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 955 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 956 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 957 | #[derive(Debug)] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 958 | pub struct RoomMatcher<'a> { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 959 | filter: &'a RoomListFilter, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 960 | search: Option<String>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 961 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 962 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 963 | impl RoomMatcher<'_> { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 964 | #[must_use] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 965 | pub fn matches(&self, room: &RoomSummary) -> bool { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 966 | let filter = self.filter; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 967 | filter |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 968 | .membership |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 969 | .is_none_or(|membership| room.membership == membership) |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 970 | && filter.category.is_none_or(|category| match category { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 971 | RoomCategory::People => room.direct && !room.space, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 972 | RoomCategory::Rooms => !room.direct && !room.space, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 973 | RoomCategory::Spaces => room.space, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 974 | }) |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 975 | && filter |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 976 | .favourite |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 977 | .is_none_or(|favourite| room.favourite == favourite) |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 978 | && (!filter.unread_only || room.unread_messages > 0 || room.unread_mentions > 0) |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 979 | && self.search.as_ref().is_none_or(|search| { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 980 | room.name.to_lowercase().contains(search) |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 981 | || room.room_id.as_str().to_lowercase().contains(search) |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 982 | }) |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 983 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 984 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 985 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 986 | #[derive(Clone, Copy, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 987 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 988 | pub enum RoomCategory { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 989 | People, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 990 | Rooms, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 991 | Spaces, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 992 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 993 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 994 | #[derive(Clone, Copy, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 995 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 996 | pub enum MemberFilter { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 997 | Active, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 998 | Joined, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 999 | Invited, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1000 | All, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1001 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1002 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1003 | #[derive(Clone, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1004 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1005 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1006 | pub enum MemberMembership { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1007 | Joined, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1008 | Invited, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1009 | Left, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1010 | Knocked, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1011 | Banned, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1012 | Custom(String), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1013 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1014 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1015 | #[derive(Clone, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1016 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1017 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1018 | pub struct MemberSummary { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1019 | pub user_id: OwnedUserId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1020 | pub name: String, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1021 | pub display_name: Option<String>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1022 | pub avatar: Option<OwnedMxcUri>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1023 | pub membership: MemberMembership, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1024 | pub own: bool, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1025 | pub name_ambiguous: bool, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1026 | pub ignored: bool, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1027 | pub service: bool, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1028 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1029 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1030 | #[derive(Clone, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1031 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1032 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1033 | pub struct OwnDevice { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1034 | pub device_id: OwnedDeviceId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1035 | pub display_name: Option<String>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1036 | pub last_seen_ip: Option<String>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1037 | pub last_seen_timestamp_ms: Option<u64>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1038 | pub current: bool, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1039 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1040 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1041 | #[derive(Clone, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1042 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 1043 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1044 | pub enum TimelineItem { |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1045 | Event(Box<TimelineEvent>), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1046 | DayDivider { timestamp_ms: u64 }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1047 | ReadMarker, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1048 | TimelineStart, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1049 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1050 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1051 | #[derive(Clone, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1052 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1053 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1054 | pub enum TimelineDiff { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1055 | Append { values: Vec<TimelineItem> }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1056 | Clear, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1057 | PushFront { value: TimelineItem }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1058 | PushBack { value: TimelineItem }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1059 | PopFront, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1060 | PopBack, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1061 | Insert { index: usize, value: TimelineItem }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1062 | Set { index: usize, value: TimelineItem }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1063 | Remove { index: usize }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1064 | Truncate { length: usize }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1065 | Reset { values: Vec<TimelineItem> }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1066 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1067 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1068 | #[derive(Clone, Copy, Debug, Eq, PartialEq, thiserror::Error)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1069 | #[error("timeline diff is incompatible with the current {length}-item snapshot")] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1070 | pub struct TimelineDiffError { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1071 | pub length: usize, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1072 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1073 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1074 | impl TimelineDiff { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1075 | /// Apply a diff only when its indices match the current snapshot. |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1076 | /// On error the snapshot is unchanged; request `TimelineCommand::Resync` |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1077 | /// and ignore further diffs until the corresponding `TimelineReset`. |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1078 | pub fn try_apply(self, items: &mut Vec<TimelineItem>) -> Result<(), TimelineDiffError> { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1079 | let length = items.len(); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1080 | match self { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1081 | Self::Append { values } => items.extend(values), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1082 | Self::Clear => items.clear(), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1083 | Self::PushFront { value } => items.insert(0, value), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1084 | Self::PushBack { value } => items.push(value), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1085 | Self::PopFront if length == 0 => return Err(TimelineDiffError { length }), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1086 | Self::PopFront => { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1087 | items.remove(0); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1088 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1089 | Self::PopBack if length == 0 => return Err(TimelineDiffError { length }), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1090 | Self::PopBack => { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1091 | items.pop(); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1092 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1093 | Self::Insert { index, .. } if index > length => { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1094 | return Err(TimelineDiffError { length }); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1095 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1096 | Self::Insert { index, value } => items.insert(index, value), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1097 | Self::Set { index, .. } if index >= length => return Err(TimelineDiffError { length }), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1098 | Self::Set { index, value } => items[index] = value, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1099 | Self::Remove { index } if index >= length => return Err(TimelineDiffError { length }), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1100 | Self::Remove { index } => { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1101 | items.remove(index); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1102 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1103 | Self::Truncate { length: target } if target > length => { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1104 | return Err(TimelineDiffError { length }); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1105 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1106 | Self::Truncate { length } => items.truncate(length), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1107 | Self::Reset { values } => *items = values, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1108 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1109 | Ok(()) |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1110 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1111 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1112 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1113 | #[cfg(test)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1114 | mod tests { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1115 | use super::{TimelineDiff, TimelineItem}; |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1116 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1117 | fn item(timestamp_ms: u64) -> TimelineItem { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1118 | TimelineItem::DayDivider { timestamp_ms } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1119 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1120 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1121 | #[test] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1122 | fn timeline_diff_try_apply_handles_every_variant() { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1123 | let mut items = vec![item(1), item(2)]; |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1124 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1125 | TimelineDiff::Append { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1126 | values: vec![item(3)], |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1127 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1128 | .try_apply(&mut items) |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1129 | .unwrap(); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1130 | assert_eq!(items, vec![item(1), item(2), item(3)]); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1131 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1132 | TimelineDiff::Clear.try_apply(&mut items).unwrap(); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1133 | assert!(items.is_empty()); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1134 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1135 | TimelineDiff::PushFront { value: item(2) } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1136 | .try_apply(&mut items) |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1137 | .unwrap(); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1138 | TimelineDiff::PushBack { value: item(3) } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1139 | .try_apply(&mut items) |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1140 | .unwrap(); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1141 | assert_eq!(items, vec![item(2), item(3)]); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1142 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1143 | TimelineDiff::PopFront.try_apply(&mut items).unwrap(); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1144 | TimelineDiff::PopBack.try_apply(&mut items).unwrap(); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1145 | assert!(items.is_empty()); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1146 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1147 | TimelineDiff::Reset { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1148 | values: vec![item(1), item(3)], |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1149 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1150 | .try_apply(&mut items) |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1151 | .unwrap(); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1152 | TimelineDiff::Insert { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1153 | index: 1, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1154 | value: item(2), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1155 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1156 | .try_apply(&mut items) |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1157 | .unwrap(); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1158 | assert_eq!(items, vec![item(1), item(2), item(3)]); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1159 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1160 | TimelineDiff::Set { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1161 | index: 1, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1162 | value: item(4), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1163 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1164 | .try_apply(&mut items) |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1165 | .unwrap(); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1166 | assert_eq!(items, vec![item(1), item(4), item(3)]); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1167 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1168 | TimelineDiff::Remove { index: 1 } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1169 | .try_apply(&mut items) |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1170 | .unwrap(); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1171 | assert_eq!(items, vec![item(1), item(3)]); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1172 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1173 | TimelineDiff::Truncate { length: 1 } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1174 | .try_apply(&mut items) |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1175 | .unwrap(); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1176 | assert_eq!(items, vec![item(1)]); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1177 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1178 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1179 | #[test] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1180 | fn invalid_timeline_diff_leaves_snapshot_unchanged() { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1181 | let invalid = [ |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1182 | TimelineDiff::Insert { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1183 | index: 3, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1184 | value: item(3), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1185 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1186 | TimelineDiff::Set { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1187 | index: 2, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1188 | value: item(3), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1189 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1190 | TimelineDiff::Remove { index: 2 }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1191 | TimelineDiff::Truncate { length: 3 }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1192 | ]; |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1193 | for diff in invalid { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1194 | let mut items = vec![item(1), item(2)]; |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1195 | assert_eq!(diff.try_apply(&mut items).unwrap_err().length, 2); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1196 | assert_eq!(items, vec![item(1), item(2)]); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1197 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1198 | for diff in [TimelineDiff::PopFront, TimelineDiff::PopBack] { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1199 | let mut items = Vec::new(); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1200 | assert_eq!(diff.try_apply(&mut items).unwrap_err().length, 0); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1201 | assert!(items.is_empty()); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1202 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1203 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1204 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1205 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1206 | #[derive(Clone, Debug, Eq, Hash, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1207 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1208 | pub struct TimelineItemId(String); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1209 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1210 | impl TimelineItemId { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1211 | pub(crate) fn new(value: String) -> Self { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1212 | Self(value) |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1213 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1214 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1215 | #[must_use] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1216 | pub fn as_str(&self) -> &str { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1217 | &self.0 |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1218 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1219 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1220 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1221 | #[derive(Clone, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1222 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1223 | #[non_exhaustive] |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1224 | pub struct TimelineEvent { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1225 | pub item_id: TimelineItemId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1226 | pub event_id: Option<OwnedEventId>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1227 | pub transaction_id: Option<OwnedTransactionId>, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1228 | pub sender: Sender, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1229 | pub timestamp_ms: u64, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1230 | pub own: bool, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1231 | pub send_state: SendState, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1232 | pub content: TimelineContent, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1233 | pub reply_to: Option<ReplyReference>, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1234 | pub thread_root: Option<OwnedEventId>, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1235 | pub thread_summary: Option<ThreadSummary>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1236 | pub reactions: Vec<Reaction>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1237 | pub read_by: Vec<OwnedUserId>, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1238 | pub editable: bool, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1239 | } |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1240 | |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1241 | impl TimelineEvent { |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1242 | /// what to hand edit, redact and react. works before the server has echoed it back |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1243 | #[must_use] |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1244 | pub fn target(&self) -> Option<EventRef> { |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1245 | self.event_id |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1246 | .clone() |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1247 | .map(EventRef::Remote) |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1248 | .or_else(|| self.transaction_id.clone().map(EventRef::Local)) |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1249 | } |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1250 | } |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1251 | |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1252 | #[derive(Clone, Debug, Eq, Hash, PartialEq)] |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1253 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1254 | #[non_exhaustive] |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1255 | pub enum EventRef { |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1256 | Remote(OwnedEventId), |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1257 | /// a local echo, by the transaction id it was queued under |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1258 | Local(OwnedTransactionId), |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1259 | } |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1260 | |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1261 | impl From<OwnedEventId> for EventRef { |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1262 | fn from(event_id: OwnedEventId) -> Self { |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1263 | Self::Remote(event_id) |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1264 | } |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1265 | } |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1266 | |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1267 | #[derive(Clone, Debug, Eq, PartialEq)] |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1268 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1269 | #[non_exhaustive] |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1270 | pub struct Sender { |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1271 | pub user_id: OwnedUserId, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1272 | pub display_name: Option<String>, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1273 | pub avatar: Option<OwnedMxcUri>, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1274 | /// someone else in the room goes by the same name, so show the user id too |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1275 | pub name_ambiguous: bool, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1276 | } |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1277 | |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1278 | impl Sender { |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1279 | #[must_use] |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1280 | pub fn name(&self) -> &str { |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1281 | self.display_name |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1282 | .as_deref() |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1283 | .unwrap_or_else(|| self.user_id.as_str()) |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1284 | } |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1285 | } |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1286 | |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1287 | #[derive(Clone, Debug, Eq, PartialEq)] |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1288 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1289 | #[non_exhaustive] |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1290 | pub enum TimelineContent { |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1291 | Message(Message), |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1292 | Sticker { |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1293 | body: String, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1294 | media: MediaDescriptor, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1295 | }, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1296 | Poll { |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1297 | question: String, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1298 | }, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1299 | Redacted, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1300 | UnableToDecrypt(UtdCause), |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1301 | Membership { |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1302 | user_id: OwnedUserId, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1303 | display_name: Option<String>, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1304 | change: MembershipChange, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1305 | }, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1306 | Profile { |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1307 | user_id: OwnedUserId, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1308 | display_name: Option<Change<Option<String>>>, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1309 | avatar: Option<Change<Option<OwnedMxcUri>>>, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1310 | }, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1311 | /// `None` means it was cleared |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1312 | RoomName(Option<String>), |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1313 | RoomTopic(Option<String>), |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1314 | RoomAvatar(Option<OwnedMxcUri>), |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1315 | EncryptionEnabled, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1316 | RoomCreated, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1317 | RoomUpgraded { |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1318 | successor: OwnedRoomId, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1319 | }, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1320 | OtherState { |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1321 | event_type: String, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1322 | state_key: String, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1323 | }, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1324 | Other { |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1325 | event_type: String, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1326 | }, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1327 | } |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1328 | |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1329 | #[derive(Clone, Debug, Eq, PartialEq)] |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1330 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1331 | #[non_exhaustive] |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1332 | pub struct Message { |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1333 | pub kind: MessageKind, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1334 | pub body: String, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1335 | pub formatted_body: Option<String>, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1336 | pub mentions: Option<MessageMentions>, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1337 | pub edited: bool, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1338 | pub media: Option<MediaDescriptor>, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1339 | } |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1340 | |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1341 | #[derive(Clone, Debug, Eq, PartialEq)] |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1342 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1343 | #[non_exhaustive] |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1344 | pub enum MessageKind { |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1345 | Text, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1346 | Emote, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1347 | Notice, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1348 | ServerNotice, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1349 | Image, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1350 | Video, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1351 | Audio, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1352 | File, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1353 | Location, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1354 | VerificationRequest, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1355 | Other(String), |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1356 | } |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1357 | |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1358 | #[derive(Clone, Copy, Debug, Eq, PartialEq)] |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1359 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1360 | #[non_exhaustive] |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1361 | pub enum MembershipChange { |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1362 | Joined, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1363 | Left, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1364 | Banned, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1365 | Unbanned, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1366 | Kicked, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1367 | KickedAndBanned, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1368 | Invited, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1369 | InvitationAccepted, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1370 | InvitationRejected, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1371 | InvitationRevoked, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1372 | Knocked, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1373 | KnockAccepted, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1374 | KnockRetracted, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1375 | KnockDenied, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1376 | /// nothing a person would call a change, or something the sdk couldn't make sense of |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1377 | Other, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1378 | } |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1379 | |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1380 | #[derive(Clone, Debug, Eq, PartialEq)] |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1381 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1382 | pub struct Change<T> { |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1383 | pub old: T, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1384 | pub new: T, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1385 | } |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1386 | |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1387 | /// why a message couldn't be read, worth telling the user since some of these they can fix |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1388 | #[derive(Clone, Copy, Debug, Eq, PartialEq)] |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1389 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1390 | #[non_exhaustive] |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1391 | pub enum UtdCause { |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1392 | Unknown, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1393 | SentBeforeWeJoined, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1394 | VerificationViolation, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1395 | UnsignedDevice, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1396 | UnknownDevice, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1397 | HistoricalMessageAndBackupIsDisabled, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1398 | WithheldForUnverifiedOrInsecureDevice, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1399 | WithheldBySender, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1400 | HistoricalMessageAndDeviceIsUnverified, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1401 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1402 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1403 | #[derive(Clone, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1404 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1405 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1406 | pub struct ThreadSummary { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1407 | pub reply_count: u32, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1408 | pub latest_event_id: Option<OwnedEventId>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1409 | pub latest_event_timestamp_ms: Option<u64>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1410 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1411 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1412 | #[derive(Clone, Copy, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1413 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1414 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1415 | pub enum SendState { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1416 | Sent, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1417 | Queued, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1418 | Sending, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1419 | Failed { retriable: bool }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1420 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1421 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1422 | #[derive(Clone, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1423 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 1424 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1425 | pub struct ReplyReference { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1426 | pub event_id: OwnedEventId, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1427 | pub details: ReplyDetails, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1428 | } |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1429 | |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1430 | /// the replied-to event. macltok asks for it when it isn't loaded, `Pending` then turns into one of the others |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1431 | #[derive(Clone, Debug, Eq, PartialEq)] |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1432 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1433 | #[non_exhaustive] |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1434 | pub enum ReplyDetails { |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1435 | Pending, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1436 | Ready { |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1437 | sender: Sender, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1438 | content: Box<TimelineContent>, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1439 | timestamp_ms: u64, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1440 | }, |
960ac0721079 | atagen | 2026-09-25 00:24 UTC | 1441 | Unavailable, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1442 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1443 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1444 | #[derive(Clone, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1445 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1446 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1447 | pub struct Reaction { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1448 | pub key: String, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1449 | pub count: usize, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1450 | pub own: bool, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1451 | pub senders: Vec<OwnedUserId>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1452 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1453 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1454 | #[derive(Clone, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1455 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1456 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1457 | pub struct MediaDescriptor { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1458 | pub id: MediaId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1459 | pub kind: MediaKind, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1460 | pub filename: String, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1461 | pub caption: Option<String>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1462 | pub mimetype: Option<String>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1463 | pub size_bytes: Option<u64>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1464 | pub width: Option<u64>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1465 | pub height: Option<u64>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1466 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1467 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1468 | #[derive(Clone, Debug, Eq, Hash, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1469 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1470 | pub struct MediaId(String); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1471 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1472 | impl MediaId { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1473 | pub(crate) fn new(value: String) -> Self { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1474 | Self(value) |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1475 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1476 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1477 | #[must_use] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1478 | pub fn as_str(&self) -> &str { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1479 | &self.0 |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1480 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1481 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1482 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1483 | impl std::fmt::Display for MediaId { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1484 | fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1485 | self.0.fmt(formatter) |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1486 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1487 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1488 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1489 | #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1490 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1491 | pub enum MediaSize { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1492 | Full, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 1493 | /// a hint. an uploader's own thumbnail wins over the server resizing anything |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 1494 | Thumbnail { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 1495 | width: u32, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 1496 | height: u32, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 1497 | }, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 1498 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 1499 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 1500 | #[derive(Clone, Debug, Eq, PartialEq)] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 1501 | #[non_exhaustive] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 1502 | pub struct Media { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 1503 | pub bytes: Arc<[u8]>, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 1504 | pub mimetype: String, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1505 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1506 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1507 | #[derive(Clone, Copy, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1508 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1509 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1510 | pub enum MediaKind { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1511 | Image, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1512 | Video, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1513 | Audio, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1514 | File, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1515 | Sticker, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1516 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1517 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1518 | #[derive(Clone, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1519 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 1520 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1521 | pub struct TypingState { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1522 | pub room_id: OwnedRoomId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1523 | pub users: Vec<OwnedUserId>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1524 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1525 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1526 | #[derive(Clone, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1527 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 1528 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1529 | pub enum HistoryState { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1530 | Idle, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1531 | Loading, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1532 | StartReached, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1533 | Failed(String), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1534 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1535 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1536 | #[derive(Clone, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1537 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1538 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1539 | pub struct EncryptionState { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1540 | pub device_id: OwnedDeviceId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1541 | pub device_verified: bool, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1542 | pub recovery: RecoveryState, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1543 | pub key_backup: KeyBackupState, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1544 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1545 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1546 | #[derive(Clone, Copy, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1547 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 1548 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1549 | pub enum KeyBackupState { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1550 | Unknown, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1551 | Creating, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1552 | Enabling, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1553 | Resuming, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1554 | Downloading, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1555 | Enabled, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1556 | Disabling, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1557 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1558 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1559 | #[derive(Clone, Copy, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1560 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 1561 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1562 | pub enum RecoveryState { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1563 | Unknown, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1564 | Disabled, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1565 | Incomplete, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1566 | Enabled, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1567 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1568 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1569 | #[derive(Clone, Copy, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1570 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1571 | pub enum VerificationAction { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1572 | Confirm, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1573 | Reject, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1574 | Cancel, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1575 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1576 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1577 | #[derive(Clone, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1578 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1579 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1580 | pub enum VerificationTarget { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1581 | OwnIdentity, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1582 | User(OwnedUserId), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1583 | Device { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1584 | user_id: OwnedUserId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1585 | device_id: OwnedDeviceId, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1586 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1587 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1588 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1589 | #[derive(Clone, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1590 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 1591 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1592 | pub enum VerificationState { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1593 | Waiting, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1594 | Comparison { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1595 | emojis: Vec<(String, String)>, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1596 | decimals: (u16, u16, u16), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1597 | }, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1598 | Confirmed, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1599 | Done, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1600 | Cancelled(String), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1601 | Failed(VerificationFailure), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1602 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1603 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1604 | #[derive(Clone, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1605 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1606 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1607 | pub enum VerificationFailure { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1608 | RequestAcceptance(String), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1609 | SasStartup(String), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1610 | SasAcceptance(String), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1611 | RequestStreamEnded, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1612 | SasStreamEnded, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1613 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1614 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1615 | #[derive(Clone, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1616 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1617 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1618 | pub struct EngineFailure { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1619 | pub kind: EngineErrorKind, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1620 | pub message: String, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1621 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1622 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1623 | #[derive(Clone, Copy, Debug, Eq, PartialEq)] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1624 | #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1625 | #[non_exhaustive] |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1626 | pub enum EngineErrorKind { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1627 | EventReceiverClosed, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1628 | Watcher, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1629 | Other, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1630 | } |