From fa8bc645af1a401e72cd25c7f5e74ac6dce57681 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Mon, 20 Apr 2020 17:40:14 -0700 Subject: [PATCH] modules/client/sync/rooms/timeline: Fix join event not updating client state. --- modules/client/sync/rooms/timeline.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/client/sync/rooms/timeline.cc b/modules/client/sync/rooms/timeline.cc index 8733ec877..759ecf7a1 100644 --- a/modules/client/sync/rooms/timeline.cc +++ b/modules/client/sync/rooms/timeline.cc @@ -135,9 +135,16 @@ ircd::m::sync::room_timeline_linear(data &data) // displayname and avatar changes). if(is_own_join && !is_own_rejoin) { - const scope_restore range_first + const event::idx range_first { - data.range.first, last_membership_state_idx + last_membership_state_idx? + last_membership_state_idx + 1: // start after last state + last_membership_state_idx // 0 (full initial sync). + }; + + const scope_restore data_range_first + { + data.range.first, range_first }; bool ret{false}, limited{false};