96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 1 | use futures_util::{StreamExt, stream}; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 2 | use matrix_sdk::{ |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 3 | Client, Room, RoomState, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 4 | deserialized_responses::SyncOrStrippedState, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 5 | latest_events::LatestEventValue, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 6 | ruma::events::{ |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 7 | AnyMessageLikeEventContent, AnySyncMessageLikeEvent, AnySyncTimelineEvent, SyncStateEvent, |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 8 | room::message::{Relation, RoomMessageEventContent}, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 9 | space::child::SpaceChildEventContent, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 10 | }, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 11 | }; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 12 | use matrix_sdk_ui::spaces::{SpaceRoom, SpaceService}; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 13 | use ruma::OwnedRoomId; |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 14 | |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 15 | use super::message_kind; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 16 | use crate::{ |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 17 | LatestEvent, MessageKind, RoomHero, RoomMembership, RoomNotificationMode, RoomSummary, |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 18 | SendState, SpaceChild, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 19 | }; |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 20 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 21 | pub(crate) async fn room_summaries(client: &Client, spaces: &SpaceService) -> Vec<RoomSummary> { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 22 | let mut summaries = stream::iter(client.rooms()) |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 23 | .map(|room| async move { room_summary(&room, spaces).await }) |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 24 | .buffer_unordered(16) |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 25 | .collect::<Vec<_>>() |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 26 | .await; |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 27 | summaries.sort_by(|left, right| { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 28 | right |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 29 | .latest_event_timestamp_ms |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 30 | .cmp(&left.latest_event_timestamp_ms) |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 31 | .then_with(|| left.name.to_lowercase().cmp(&right.name.to_lowercase())) |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 32 | .then_with(|| left.room_id.cmp(&right.room_id)) |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 33 | }); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 34 | summaries |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 35 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 36 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 37 | async fn room_summary(room: &Room, spaces: &SpaceService) -> RoomSummary { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 38 | let name = room |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 39 | .display_name() |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 40 | .await |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 41 | .map(|name| name.to_string()) |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 42 | .unwrap_or_else(|_| room.room_id().to_string()); |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 43 | let custom_notification_mode = room.user_defined_notification_mode().await; |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 44 | let effective_notification_mode = match custom_notification_mode { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 45 | Some(mode) => Some(mode), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 46 | None => room.notification_mode().await, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 47 | }; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 48 | let inviter = match room.state() { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 49 | RoomState::Invited => room |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 50 | .invite_details() |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 51 | .await |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 52 | .ok() |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 53 | .map(|invite| invite.inviter_id), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 54 | _ => None, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 55 | }; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 56 | let children = if room.is_space() { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 57 | space_children(room).await |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 58 | } else { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 59 | Vec::new() |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 60 | }; |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 61 | RoomSummary { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 62 | room_id: room.room_id().to_owned(), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 63 | name, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 64 | membership: membership(room.state()), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 65 | unread_messages: room.num_unread_messages(), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 66 | unread_mentions: room.num_unread_mentions(), |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 67 | unread_notifications: room.num_unread_notifications(), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 68 | encrypted: room.encryption_state().is_encrypted(), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 69 | space: room.is_space(), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 70 | direct: room.is_direct().await.unwrap_or(false), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 71 | favourite: room.is_favourite(), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 72 | low_priority: room.is_low_priority(), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 73 | avatar: room.avatar_url(), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 74 | latest_event_timestamp_ms: room |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 75 | .latest_event_timestamp() |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 76 | .map(|value| value.get().into()), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 77 | latest_event: latest_event(room), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 78 | notification_mode: effective_notification_mode.map(notification_mode), |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 79 | notification_mode_custom: custom_notification_mode.is_some(), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 80 | topic: room.topic(), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 81 | canonical_alias: room.canonical_alias(), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 82 | joined_members: room.joined_members_count(), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 83 | invited_members: room.invited_members_count(), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 84 | heroes: room |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 85 | .heroes() |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 86 | .into_iter() |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 87 | .map(|hero| RoomHero { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 88 | user_id: hero.user_id, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 89 | display_name: hero.display_name, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 90 | avatar: hero.avatar_url, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 91 | }) |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 92 | .collect(), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 93 | successor: room.successor_room().map(|successor| successor.room_id), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 94 | inviter, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 95 | parent_spaces: spaces |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 96 | .joined_parents_of_child(room.room_id()) |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 97 | .await |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 98 | .into_iter() |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 99 | .map(|parent| parent.room_id) |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 100 | .collect(), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 101 | children, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 102 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 103 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 104 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 105 | const fn membership(state: RoomState) -> RoomMembership { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 106 | match state { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 107 | RoomState::Joined => RoomMembership::Joined, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 108 | RoomState::Invited => RoomMembership::Invited, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 109 | RoomState::Left => RoomMembership::Left, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 110 | RoomState::Knocked => RoomMembership::Knocked, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 111 | RoomState::Banned => RoomMembership::Banned, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 112 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 113 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 114 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 115 | /// what the space itself lists, straight from local state. redacted children don't count |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 116 | async fn space_children(room: &Room) -> Vec<OwnedRoomId> { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 117 | let Ok(events) = room |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 118 | .get_state_events_static::<SpaceChildEventContent>() |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 119 | .await |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 120 | else { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 121 | return Vec::new(); |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 122 | }; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 123 | events |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 124 | .into_iter() |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 125 | .filter_map(|event| match event.deserialize().ok()? { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 126 | SyncOrStrippedState::Sync(SyncStateEvent::Original(event)) => Some(event.state_key), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 127 | SyncOrStrippedState::Stripped(event) => Some(event.state_key), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 128 | SyncOrStrippedState::Sync(SyncStateEvent::Redacted(_)) => None, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 129 | }) |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 130 | .collect() |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 131 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 132 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 133 | fn latest_event(room: &Room) -> Option<LatestEvent> { |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 134 | let own = || Some(room.own_user_id().to_owned()); |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 135 | let local = |local: &matrix_sdk::latest_events::LocalLatestEventValue| { |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 136 | let preview = match local.content.deserialize() { |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 137 | Ok(AnyMessageLikeEventContent::RoomMessage(content)) => preview(&content), |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 138 | _ => (None, None), |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 139 | }; |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 140 | (preview, Some(local.timestamp)) |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 141 | }; |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 142 | let (sender, (kind, body), timestamp, send_state) = match room.latest_event() { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 143 | LatestEventValue::None => return None, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 144 | LatestEventValue::Remote(event) => { |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 145 | let preview = match event.raw().deserialize() { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 146 | Ok(AnySyncTimelineEvent::MessageLike(AnySyncMessageLikeEvent::RoomMessage( |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 147 | message, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 148 | ))) => message |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 149 | .as_original() |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 150 | .map_or((None, None), |message| preview(&message.content)), |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 151 | _ => (None, None), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 152 | }; |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 153 | (event.sender(), preview, event.timestamp(), SendState::Sent) |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 154 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 155 | LatestEventValue::RemoteInvite { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 156 | timestamp, inviter, .. |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 157 | } => (inviter, (None, None), Some(timestamp), SendState::Sent), |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 158 | LatestEventValue::LocalIsSending(value) => { |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 159 | let (preview, timestamp) = local(&value); |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 160 | (own(), preview, timestamp, SendState::Sending) |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 161 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 162 | LatestEventValue::LocalHasBeenSent { value, .. } => { |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 163 | let (preview, timestamp) = local(&value); |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 164 | (own(), preview, timestamp, SendState::Sent) |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 165 | } |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 166 | // the sdk won't say whether it'll retry, so assume the user has to |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 167 | LatestEventValue::LocalCannotBeSent(value) => { |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 168 | let (preview, timestamp) = local(&value); |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 169 | ( |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 170 | own(), |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 171 | preview, |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 172 | timestamp, |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 173 | SendState::Failed { will_retry: false }, |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 174 | ) |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 175 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 176 | }; |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 177 | Some(LatestEvent { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 178 | sender, |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 179 | kind, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 180 | body, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 181 | timestamp_ms: timestamp.map(|timestamp| timestamp.get().into()), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 182 | send_state, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 183 | }) |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 184 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 185 | |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 186 | /// the latest event of an edited message is the edit, whose own body is the `* fallback` |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 187 | fn preview(content: &RoomMessageEventContent) -> (Option<MessageKind>, Option<String>) { |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 188 | let msgtype = match &content.relates_to { |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 189 | Some(Relation::Replacement(replacement)) => &replacement.new_content.msgtype, |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 190 | _ => &content.msgtype, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 191 | }; |
5a52012c9b1d | atagen | 2026-09-24 23:45 UTC | 192 | (Some(message_kind(msgtype)), Some(msgtype.body().to_owned())) |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 193 | } |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 194 | |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 195 | pub(crate) fn space_child(room: SpaceRoom) -> SpaceChild { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 196 | SpaceChild { |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 197 | name: room.display_name, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 198 | room_id: room.room_id, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 199 | topic: room.topic, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 200 | avatar: room.avatar_url, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 201 | canonical_alias: room.canonical_alias, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 202 | joined_members: room.num_joined_members, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 203 | space: room.room_type == Some(ruma::room::RoomType::Space), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 204 | children_count: room.children_count, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 205 | membership: room.state.map(membership), |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 206 | via: room.via, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 207 | suggested: room.suggested, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 208 | world_readable: room.world_readable, |
31ce2453c82f | atagen | 2026-09-24 13:07 UTC | 209 | guest_can_join: room.guest_can_join, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 210 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 211 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 212 | |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 213 | pub(crate) const fn notification_mode( |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 214 | mode: matrix_sdk::notification_settings::RoomNotificationMode, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 215 | ) -> RoomNotificationMode { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 216 | match mode { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 217 | matrix_sdk::notification_settings::RoomNotificationMode::AllMessages => { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 218 | RoomNotificationMode::AllMessages |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 219 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 220 | matrix_sdk::notification_settings::RoomNotificationMode::MentionsAndKeywordsOnly => { |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 221 | RoomNotificationMode::MentionsAndKeywordsOnly |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 222 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 223 | matrix_sdk::notification_settings::RoomNotificationMode::Mute => RoomNotificationMode::Mute, |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 224 | } |
96fdf90aacd6 | atagen | 2026-09-08 08:24 UTC | 225 | } |