From 93bed7bc633ce791b9f898de1ef4448415da5d8c Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Mon, 20 Feb 2023 13:27:39 -0800 Subject: [PATCH] modules/client/sync/rooms: Fix m.room.create not synced to creator prior to join. --- modules/client/sync/rooms.cc | 7 ++++--- modules/client/sync/rooms/state.cc | 4 ++-- modules/client/sync/rooms/timeline.cc | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/client/sync/rooms.cc b/modules/client/sync/rooms.cc index 690c6d364..d9ed638d8 100644 --- a/modules/client/sync/rooms.cc +++ b/modules/client/sync/rooms.cc @@ -58,10 +58,11 @@ ircd::m::sync::rooms_linear(data &data) char membuf[room::MEMBERSHIP_MAX_SIZE]; const string_view &membership { - json::get<"room_id"_>(*data.event)? + data.room && m::creation(*data.event, data.user)? + "join"_sv: + data.room? m::membership(membuf, room, data.user): - - string_view{} + string_view{} }; const scope_restore their_membership diff --git a/modules/client/sync/rooms/state.cc b/modules/client/sync/rooms/state.cc index fcd1c9e16..3f516aa3a 100644 --- a/modules/client/sync/rooms/state.cc +++ b/modules/client/sync/rooms/state.cc @@ -109,7 +109,7 @@ ircd::m::sync::room_state_linear_events(data &data) const bool is_own_room_join { - is_own_join + (is_own_join || m::creation(*data.event, data.user)) && m::creator(*data.room, data.user) }; @@ -141,7 +141,7 @@ ircd::m::sync::room_state_linear_events(data &data) { viewport_size <= 0 || data.membership == "invite" - || sounding < viewport_size + || sounding <= viewport_size }; // Query whether this state cell has been overwritten. Unlike the timeline, diff --git a/modules/client/sync/rooms/timeline.cc b/modules/client/sync/rooms/timeline.cc index a0b8e6d78..77cedad3b 100644 --- a/modules/client/sync/rooms/timeline.cc +++ b/modules/client/sync/rooms/timeline.cc @@ -105,7 +105,7 @@ ircd::m::sync::room_timeline_linear(data &data) const bool viewport_visible { viewport_size <= 0 - || sounding < viewport_size + || sounding <= viewport_size }; const bool is_own_membership