From a3039af449d758b978aef50694249e0d880dec3f Mon Sep 17 00:00:00 2001 From: Till Faelligen Date: Thu, 20 Jan 2022 11:28:12 +0100 Subject: [PATCH] Let wakeupUsers handle which users to wake --- syncapi/notifier/notifier.go | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/syncapi/notifier/notifier.go b/syncapi/notifier/notifier.go index c78347827..e66109b9c 100644 --- a/syncapi/notifier/notifier.go +++ b/syncapi/notifier/notifier.go @@ -224,26 +224,13 @@ func (n *Notifier) OnNewPresence( defer n.streamLock.Unlock() var wakeUserIDs []string - _, wantDomain, err := gomatrixserverlib.SplitID('@', userID) - if err != nil { - return - } - // determine if users share a room and needs to be woken up for _, users := range n.roomIDToJoinedUsers { // user sending presence is not in room if !users[userID] { continue } - // check all users in room - for user := range users { - _, domain, err := gomatrixserverlib.SplitID('@', user) - if err != nil { - return - } - if domain == wantDomain { - wakeUserIDs = append(wakeUserIDs, user) - } - } + + wakeUserIDs = append(wakeUserIDs, users.values()...) } n.currPos.ApplyUpdates(posUpdate)