Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1717ddb30f |
16
commands.go
16
commands.go
@@ -706,9 +706,25 @@ func fnBridge(ce *WrappedCommandEvent) {
|
||||
}
|
||||
portal := ce.User.GetExistingPortalByID(channelID)
|
||||
if portal == nil {
|
||||
// HACK: Before giving up, discover if the user is trying to join a
|
||||
// thread. Then, cause the creation of a portal.
|
||||
// This is for forum channel threads; they don't show up on the
|
||||
// forum channels.
|
||||
ch, err := ce.User.Session.Channel(channelID)
|
||||
if err != nil {
|
||||
ce.Reply("Channel not found")
|
||||
return
|
||||
}
|
||||
|
||||
if ch.Type != discordgo.ChannelTypeGuildPublicThread &&
|
||||
ch.Type != discordgo.ChannelTypeGuildPrivateThread {
|
||||
return
|
||||
}
|
||||
|
||||
ce.ZLog.Debug().Msg("Adding public / private thread as a portal")
|
||||
portal = ce.User.GetPortalByID(channelID, ch.Type)
|
||||
|
||||
}
|
||||
portal.roomCreateLock.Lock()
|
||||
defer portal.roomCreateLock.Unlock()
|
||||
if portal.MXID != "" {
|
||||
|
||||
Reference in New Issue
Block a user