Fix confusion between initial / stripped state events

InviteState contains stripped state events, and initial state events are
not used anywhere in the sync response.
This commit is contained in:
Jonas Platte 2021-09-11 22:28:38 +02:00 committed by Damir Jelić
parent 1ea9c9a915
commit 140630745f
2 changed files with 8 additions and 13 deletions

View file

@ -2191,8 +2191,12 @@ impl Client {
}
// FIXME: Destructure room_info
self.handle_sync_events(EventKind::InitialState, &room, &room_info.invite_state.events)
.await?;
self.handle_sync_events(
EventKind::StrippedState,
&room,
&room_info.invite_state.events,
)
.await?;
}
for handler in &*self.notification_handlers.read().await {

View file

@ -47,7 +47,7 @@ pub enum EventKind {
EphemeralRoomData,
Message { redacted: bool },
State { redacted: bool },
StrippedState { redacted: bool },
StrippedState,
InitialState,
ToDevice,
Presence,
@ -398,8 +398,7 @@ mod static_events {
where
C: StaticEventContent + events::StateEventContent,
{
const ID: (EventKind, &'static str) =
(EventKind::StrippedState { redacted: false }, C::TYPE);
const ID: (EventKind, &'static str) = (EventKind::StrippedState, C::TYPE);
}
impl<C> SyncEvent for events::InitialStateEvent<C>
@ -433,12 +432,4 @@ mod static_events {
{
const ID: (EventKind, &'static str) = (EventKind::State { redacted: true }, C::TYPE);
}
impl<C> SyncEvent for events::RedactedStrippedStateEvent<C>
where
C: StaticEventContent + events::RedactedStateEventContent,
{
const ID: (EventKind, &'static str) =
(EventKind::StrippedState { redacted: true }, C::TYPE);
}
}