Fix handling new messages during initial portal backfill

This commit is contained in:
Tulir Asokan
2020-05-28 20:35:43 +03:00
parent 7cf19b0908
commit c72610f3f0
3 changed files with 19 additions and 9 deletions

View File

@@ -145,8 +145,6 @@ func (user *User) GetPortals() []*Portal {
portals := make([]*Portal, len(keys))
user.bridge.portalsLock.Lock()
defer user.bridge.portalsLock.Unlock()
for i, key := range keys {
portal, ok := user.bridge.portalsByJID[key]
if !ok {
@@ -154,6 +152,7 @@ func (user *User) GetPortals() []*Portal {
}
portals[i] = portal
}
user.bridge.portalsLock.Unlock()
return portals
}