Explorar el Código

Add newly created portals to personal filtering community

Tulir Asokan hace 5 años
padre
commit
eb3595bd39
Se han modificado 2 ficheros con 2 adiciones y 1 borrados
  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 {
 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

+ 1 - 0
portal.go

@@ -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)