Add puppet to personal filtering community when adding portal

This commit is contained in:
Tulir Asokan
2020-01-07 21:25:41 +02:00
parent a7601fa4cc
commit 8c3807a16d
3 changed files with 37 additions and 0 deletions

View File

@ -449,6 +449,10 @@ func (user *User) syncPortals(chatMap map[string]whatsapp.Chat, createAll bool)
var inCommunity, ok bool
if inCommunity, ok = existingKeys[portal.Key]; !ok || !inCommunity {
inCommunity = user.addPortalToCommunity(portal)
if portal.IsPrivateChat() {
puppet := user.bridge.GetPuppetByJID(portal.Key.JID)
user.addPuppetToCommunity(puppet)
}
}
portalKeys = append(portalKeys, database.PortalKeyWithMeta{PortalKey: portal.Key, InCommunity: inCommunity})
}