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,7 +2191,11 @@ impl Client {
} }
// FIXME: Destructure room_info // FIXME: Destructure room_info
self.handle_sync_events(EventKind::InitialState, &room, &room_info.invite_state.events) self.handle_sync_events(
EventKind::StrippedState,
&room,
&room_info.invite_state.events,
)
.await?; .await?;
} }

View file

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