diff --git a/community.go b/community.go index c7d9608..bda8ee1 100644 --- a/community.go +++ b/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 diff --git a/portal.go b/portal.go index 9c559c1..d48f90e 100644 --- a/portal.go +++ b/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)