Commit 8a94921c88

8a94921c88fc145c8bca612afbb2d6a19be43347

parent: 1dfdbb7098

Unregistered key

vaw <git@nlih.de> · 2026-11-11 20:55 UTC

Small fixes

Layout: unified · split

src/base.rs +2 −2
@@ -1400,7 +1400,6 @@ pub struct Thread {
14001400 messages: Messages,
14011401
14021402 root: Option<Message>,
1403 // TODO: check access
14041403 pub(crate) summary: Option<ThreadSummary>,
14051404
14061405 pub(crate) unreads: ReadReceipts,
@@ -1435,7 +1434,7 @@ impl Thread {
14351434 root: &EventId,
14361435 store: &AsyncProgramStore,
14371436 ) {
1438 if self.update_handle.is_some() {
1437 if self.update_handle.as_ref().is_some_and(|handle| !handle.is_finished()) {
14391438 return;
14401439 }
14411440
@@ -1689,6 +1688,7 @@ impl RoomInfo {
16891688 }
16901689 }
16911690
1691 /// Spawn subscriber tasks for all thread updates.
16921692 pub(crate) async fn subscribe_thread_updates(
16931693 &mut self,
16941694 room: &MatrixRoom,
src/message/mod.rs +3 −6
@@ -1027,12 +1027,9 @@ impl<'a> MessageFormatter<'a> {
10271027
10281028 if num > 0 {
10291029 threaded.push_str(" (", style);
1030 threaded.push_span_nobreak(Span::styled(
1031 thread.unreads.num_mentions.to_string(),
1032 style.bold(),
1033 ));
1030 threaded.push_span_nobreak(Span::styled(num.to_string(), style.bold()));
10341031 threaded.push_str(" ", style);
1035 if is_plural {
1032 if num > 1 {
10361033 threaded.push_str(plural, style);
10371034 } else {
10381035 threaded.push_str(singular, style);
@@ -1183,7 +1180,7 @@ impl Message {
11831180 }
11841181
11851182 /// The read receipt thread that this message was inserted into.
1186 fn receipt_thread(&self, info: &RoomInfo) -> ReceiptThread {
1183 pub(crate) fn receipt_thread(&self, info: &RoomInfo) -> ReceiptThread {
11871184 self.event
11881185 .event_id()
11891186 .and_then(|event_id| info.get_receipt_thread(event_id))
src/windows/room/message.rs +1 −5
@@ -380,12 +380,8 @@ impl StatefulWidget for MessageWidget<'_> {
380380 // receipts
381381 if saved_tunables.read_receipt_display &&
382382 let Some(event_id) = msg.event.event_id() &&
383 let Some((thread, _)) = info.get_message_location(event_id)
383 let Some(thread) = info.get_receipt_thread(event_id)
384384 {
385 let thread = match thread {
386 Some(root) => ReceiptThread::Thread(root.to_owned()),
387 None => ReceiptThread::Main,
388 };
389385 let receipts = info
390386 .event_receipts(&thread)
391387 .into_iter()
src/worker.rs +10 −9
@@ -762,6 +762,7 @@ pub(crate) async fn subscribe_thread_updates(
762762 Ok(tokio::spawn(async move {
763763 let _drop_handle = drop_handle;
764764
765 // Insert the initial events
765766 {
766767 let msgs = get_receipts_for_timeline_events(&room, initial_events).await;
767768 let mut locked = store.lock().await;
@@ -789,13 +790,13 @@ pub(crate) async fn subscribe_thread_updates(
789790 return
790791 };
791792
792 store
793 .lock()
794 .await
795 .application
796 .get_room_info(room.room_id().to_owned())
797 .get_thread_mut(thread_id.clone())
798 .unreads = update.read_receipts;
793 store
794 .lock()
795 .await
796 .application
797 .get_room_info(room.room_id().to_owned())
798 .get_thread_mut(thread_id.clone())
799 .unreads = update.read_receipts;
799800 }
800801 }
801802 }
@@ -809,8 +810,8 @@ async fn handle_thread_update(
809810) {
810811 match update {
811812 ThreadEventCacheUpdate::UpdateTimelineEvents(diffs) => {
812 // Ignore the update itself and just collect the changed items. Because we index by
813 // `MessageKey`, the correct events should be replaced.
813 // Ignore the update itself and just collect the changed items.
814 // The updated events will be replaced because we index by `MessageKey`.
814815 let events = diffs
815816 .diffs
816817 .into_iter()