mirror of
https://github.com/youwen5/iamb.git
synced 2025-06-19 21:29:52 -07:00
Add configuration option for hiding state events (#447)
This commit is contained in:
parent
ba7d0392d8
commit
c420c9dd65
3 changed files with 20 additions and 11 deletions
|
@ -362,7 +362,9 @@ fn load_insert(
|
|||
continue;
|
||||
},
|
||||
AnyTimelineEvent::State(msg) => {
|
||||
info.insert_any_state(msg.into());
|
||||
if settings.tunables.state_event_display {
|
||||
info.insert_any_state(msg.into());
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -1059,17 +1061,19 @@ impl ClientWorker {
|
|||
},
|
||||
);
|
||||
|
||||
let _ = self.client.add_event_handler(
|
||||
|ev: AnySyncStateEvent, room: MatrixRoom, store: Ctx<AsyncProgramStore>| {
|
||||
async move {
|
||||
let room_id = room.room_id();
|
||||
let mut locked = store.lock().await;
|
||||
if self.settings.tunables.state_event_display {
|
||||
let _ = self.client.add_event_handler(
|
||||
|ev: AnySyncStateEvent, room: MatrixRoom, store: Ctx<AsyncProgramStore>| {
|
||||
async move {
|
||||
let room_id = room.room_id();
|
||||
let mut locked = store.lock().await;
|
||||
|
||||
let info = locked.application.get_room_info(room_id.to_owned());
|
||||
info.insert_any_state(ev);
|
||||
}
|
||||
},
|
||||
);
|
||||
let info = locked.application.get_room_info(room_id.to_owned());
|
||||
info.insert_any_state(ev);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
let _ = self.client.add_event_handler(
|
||||
|ev: OriginalSyncRoomRedactionEvent,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue