Fetch portal info before doing background sync

This ensures it doesn't re-add you if you left the group
This commit is contained in:
Tulir Asokan 2022-06-30 16:59:51 +03:00
parent 4b69c16f1a
commit 0c0a55b940

View file

@ -309,8 +309,13 @@ func (user *User) doPuppetResync() {
}
}
for _, portal := range portals {
groupInfo, err := user.Client.GetGroupInfo(portal.Key.JID)
if err != nil {
user.log.Warnfln("Failed to get group info for %s to do background sync: %v", portal.Key.JID, err)
} else {
user.log.Debugfln("Doing background sync for %s", portal.Key.JID)
portal.UpdateMatrixRoom(user, nil)
portal.UpdateMatrixRoom(user, groupInfo)
}
}
if len(puppetJIDs) == 0 {
return