Add newly created portals to personal filtering community

This commit is contained in:
Tulir Asokan 2019-08-10 15:44:05 +03:00
parent 64e517da25
commit eb3595bd39
2 changed files with 2 additions and 1 deletions

View file

@ -84,7 +84,7 @@ func (user *User) createCommunity() {
} }
func (user *User) addPortalToCommunity(portal *Portal) bool { func (user *User) addPortalToCommunity(portal *Portal) bool {
if len(user.CommunityID) == 0 { if len(user.CommunityID) == 0 || len(portal.MXID) == 0 {
return false return false
} }
bot := user.bridge.Bot bot := user.bridge.Bot

View file

@ -758,6 +758,7 @@ func (portal *Portal) CreateMatrixRoom(user *User) error {
_ = customPuppet.CustomIntent().EnsureJoined(portal.MXID) _ = customPuppet.CustomIntent().EnsureJoined(portal.MXID)
} }
} }
user.addPortalToCommunity(portal)
err = portal.FillInitialHistory(user) err = portal.FillInitialHistory(user)
if err != nil { if err != nil {
portal.log.Errorln("Failed to fill history:", err) portal.log.Errorln("Failed to fill history:", err)