Browse Source

Add newly created portals to personal filtering community

Tulir Asokan 5 years ago
parent
commit
eb3595bd39
2 changed files with 2 additions and 1 deletions
  1. 1 1
      community.go
  2. 1 0
      portal.go

+ 1 - 1
community.go

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

+ 1 - 0
portal.go

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