@@ -16,10 +16,7 @@ use matrix_sdk_common::deserialized_responses::TimelineEvent;
16
16
#[ cfg( feature = "e2e-encryption" ) ]
17
17
use ruma:: events:: SyncMessageLikeEvent ;
18
18
use ruma:: {
19
- events:: {
20
- room:: power_levels:: RoomPowerLevelsEventContent , AnySyncMessageLikeEvent ,
21
- AnySyncTimelineEvent ,
22
- } ,
19
+ events:: { AnySyncMessageLikeEvent , AnySyncTimelineEvent } ,
23
20
push:: { Action , PushConditionRoomCtx } ,
24
21
UInt , UserId ,
25
22
} ;
@@ -28,11 +25,7 @@ use tracing::{instrument, trace, warn};
28
25
#[ cfg( feature = "e2e-encryption" ) ]
29
26
use super :: { e2ee, verification} ;
30
27
use super :: { notification, Context } ;
31
- use crate :: {
32
- store:: { BaseStateStore , StateStoreExt as _} ,
33
- sync:: Timeline ,
34
- Result , Room , RoomInfo ,
35
- } ;
28
+ use crate :: { sync:: Timeline , Result , Room , RoomInfo } ;
36
29
37
30
/// Process a set of sync timeline event, and create a [`Timeline`].
38
31
///
@@ -51,8 +44,7 @@ pub async fn build<'notification, 'e2ee>(
51
44
#[ cfg( feature = "e2e-encryption" ) ] e2ee : e2ee:: E2EE < ' e2ee > ,
52
45
) -> Result < Timeline > {
53
46
let mut timeline = Timeline :: new ( timeline_inputs. limited , timeline_inputs. prev_batch ) ;
54
- let mut push_condition_room_ctx =
55
- get_push_room_context ( context, room, room_info, notification. state_store ) . await ?;
47
+ let mut push_condition_room_ctx = get_push_room_context ( context, room, room_info) . await ?;
56
48
let room_id = room. room_id ( ) ;
57
49
58
50
for raw_event in timeline_inputs. raw_events {
@@ -131,8 +123,7 @@ pub async fn build<'notification, 'e2ee>(
131
123
)
132
124
} else {
133
125
push_condition_room_ctx =
134
- get_push_room_context ( context, room, room_info, notification. state_store )
135
- . await ?;
126
+ get_push_room_context ( context, room, room_info) . await ?;
136
127
}
137
128
138
129
if let Some ( push_condition_room_ctx) = & push_condition_room_ctx {
@@ -225,7 +216,6 @@ pub async fn get_push_room_context(
225
216
context : & Context ,
226
217
room : & Room ,
227
218
room_info : & RoomInfo ,
228
- state_store : & BaseStateStore ,
229
219
) -> Result < Option < PushConditionRoomCtx > > {
230
220
let room_id = room. room_id ( ) ;
231
221
let user_id = room. own_user_id ( ) ;
@@ -245,11 +235,7 @@ pub async fn get_push_room_context(
245
235
let power_levels = if let Some ( power_levels) = context. state_changes . power_levels ( room_id) {
246
236
Some ( power_levels)
247
237
} else {
248
- state_store
249
- . get_state_event_static :: < RoomPowerLevelsEventContent > ( room_id)
250
- . await ?
251
- . and_then ( |e| e. deserialize ( ) . ok ( ) )
252
- . map ( |event| event. power_levels ( ) )
238
+ room. power_levels ( ) . await . ok ( )
253
239
} ;
254
240
255
241
Ok ( Some ( PushConditionRoomCtx {
0 commit comments