Move channelIsBridgeable check when syncing guild channels

Fixes #107
This commit is contained in:
Tulir Asokan 2023-08-04 13:47:25 +03:00
parent 0391750fea
commit 84a6fbc571

View file

@ -960,8 +960,11 @@ func (user *User) handleGuild(meta *discordgo.Guild, timestamp time.Time, isInSp
guild.UpdateInfo(user, meta)
if len(meta.Channels) > 0 {
for _, ch := range meta.Channels {
if !user.channelIsBridgeable(ch) {
continue
}
portal := user.GetPortalByMeta(ch)
if guild.BridgingMode >= database.GuildBridgeEverything && portal.MXID == "" && user.channelIsBridgeable(ch) {
if guild.BridgingMode >= database.GuildBridgeEverything && portal.MXID == "" {
err := portal.CreateMatrixRoom(user, ch)
if err != nil {
user.log.Error().Err(err).