@@ -22,6 +22,7 @@ use matrix_sdk::{
2222 crypto:: types:: events:: CryptoContextInfo ,
2323 deserialized_responses:: { EncryptionInfo , TimelineEvent } ,
2424 event_cache:: paginator:: PaginableRoom ,
25+ room:: PushContext ,
2526 AsyncTraitDeps , Result , Room , SendOutsideWasm ,
2627} ;
2728use matrix_sdk_base:: { latest_event:: LatestEvent , RoomInfo } ;
@@ -31,11 +32,10 @@ use ruma::{
3132 receipt:: { Receipt , ReceiptThread , ReceiptType } ,
3233 AnyMessageLikeEventContent , AnySyncTimelineEvent ,
3334 } ,
34- push:: { PushConditionRoomCtx , Ruleset } ,
3535 serde:: Raw ,
3636 EventId , OwnedEventId , OwnedTransactionId , OwnedUserId , RoomVersionId , UserId ,
3737} ;
38- use tracing:: { debug , error} ;
38+ use tracing:: error;
3939
4040use super :: { Profile , RedactError , TimelineBuilder } ;
4141use crate :: timeline:: { self , pinned_events_loader:: PinnedEventsRoom , Timeline } ;
@@ -104,9 +104,7 @@ pub(super) trait RoomDataProvider:
104104 /// Load the current fully-read event id, from storage.
105105 fn load_fully_read_marker ( & self ) -> impl Future < Output = Option < OwnedEventId > > + ' _ ;
106106
107- fn push_rules_and_context (
108- & self ,
109- ) -> impl Future < Output = Option < ( Ruleset , PushConditionRoomCtx ) > > + SendOutsideWasm + ' _ ;
107+ fn push_context ( & self ) -> impl Future < Output = Option < PushContext > > + SendOutsideWasm + ' _ ;
110108
111109 /// Send an event to that room.
112110 fn send (
@@ -224,24 +222,8 @@ impl RoomDataProvider for Room {
224222 unthreaded_receipts
225223 }
226224
227- async fn push_rules_and_context ( & self ) -> Option < ( Ruleset , PushConditionRoomCtx ) > {
228- match self . push_condition_room_ctx ( ) . await {
229- Ok ( Some ( push_context) ) => match self . client ( ) . account ( ) . push_rules ( ) . await {
230- Ok ( push_rules) => Some ( ( push_rules, push_context) ) ,
231- Err ( e) => {
232- error ! ( "Could not get push rules: {e}" ) ;
233- None
234- }
235- } ,
236- Ok ( None ) => {
237- debug ! ( "Could not aggregate push context" ) ;
238- None
239- }
240- Err ( e) => {
241- error ! ( "Could not get push context: {e}" ) ;
242- None
243- }
244- }
225+ async fn push_context ( & self ) -> Option < PushContext > {
226+ self . push_context ( ) . await . ok ( ) . flatten ( )
245227 }
246228
247229 async fn load_fully_read_marker ( & self ) -> Option < OwnedEventId > {
0 commit comments