@@ -275,8 +275,7 @@ impl ThreadEventCache {
275
275
subscribe_to_event_id = Some ( ( self . thread_root . clone ( ) , subscribed_to_event_id) ) ;
276
276
}
277
277
278
- let thread_subscriptions =
279
- AutomaticThreadSubscriptions ( BTreeMap :: from_iter ( subscribe_to_event_id) ) ;
278
+ let thread_subscriptions = AutomaticThreadSubscriptions :: from_iter ( subscribe_to_event_id) ;
280
279
281
280
Some ( ( BackPaginationOutcome { reached_start, events } , thread_subscriptions) )
282
281
}
@@ -292,8 +291,7 @@ impl ThreadEventCache {
292
291
///
293
292
/// Note: it's not necessarily the latest event in the thread, but the latest in
294
293
/// the thread that matches a push condition rule.
295
- #[ derive( Debug , Default ) ]
296
- pub struct AutomaticThreadSubscriptions ( pub BTreeMap < OwnedEventId , OwnedEventId > ) ;
294
+ pub type AutomaticThreadSubscriptions = BTreeMap < OwnedEventId , OwnedEventId > ;
297
295
298
296
/// A thin wrapper over a specialized [`PushContext`] that is used for computing
299
297
/// the threads subscriptions automatically.
@@ -362,11 +360,11 @@ pub async fn should_subscribe_thread(
362
360
pub async fn subscribe_to_new_threads ( room : & Room , new_thread_subs : AutomaticThreadSubscriptions ) {
363
361
// If there's no subscriptions, or the client hasn't enabled thread
364
362
// subscriptions, we don't have anything to do.
365
- if new_thread_subs. 0 . is_empty ( ) || !room. client . enabled_thread_subscriptions ( ) {
363
+ if new_thread_subs. is_empty ( ) || !room. client . enabled_thread_subscriptions ( ) {
366
364
return ;
367
365
}
368
366
369
- for ( thread_root, subscribe_up_to_event_id) in new_thread_subs. 0 {
367
+ for ( thread_root, subscribe_up_to_event_id) in new_thread_subs {
370
368
let previous_status = match room. load_or_fetch_thread_subscription ( & thread_root) . await {
371
369
Ok ( status) => status,
372
370
Err ( err) => {
0 commit comments