From 94960c507a5cac45633df5cd3245a5bb7f075b12 Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Fri, 24 Nov 2023 08:11:50 +0100 Subject: [PATCH] Move SetLatestEvents --- roomserver/internal/input/input_latest_events.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/roomserver/internal/input/input_latest_events.go b/roomserver/internal/input/input_latest_events.go index 144d22795..aa26c74d3 100644 --- a/roomserver/internal/input/input_latest_events.go +++ b/roomserver/internal/input/input_latest_events.go @@ -107,6 +107,10 @@ func (r *Inputer) updateLatestEvents( } } + if err = u.updater.SetLatestEvents(roomInfo.RoomNID, u.latest, u.stateAtEvent.EventNID, u.newStateNID); err != nil { + return fmt.Errorf("u.updater.SetLatestEvents: %w", err) + } + succeeded = true return nil } @@ -189,10 +193,6 @@ func (u *latestEventsUpdater) doUpdateLatestEvents(ctx context.Context, roomInfo u.newStateNID = u.oldStateNID } - if err = u.updater.SetLatestEvents(roomInfo.RoomNID, u.latest, u.stateAtEvent.EventNID, u.newStateNID); err != nil { - return nil, fmt.Errorf("u.updater.SetLatestEvents: %w", err) - } - return membershipUpdates, nil }