@@ -171,14 +171,17 @@ func (p *Portal) MainIntent() *appservice.IntentAPI {
|
||||
}
|
||||
|
||||
func (p *Portal) createMatrixRoom(user *User, channel *discordgo.Channel) error {
|
||||
p.roomCreateLock.Lock()
|
||||
defer p.roomCreateLock.Unlock()
|
||||
if p.MXID != "" {
|
||||
return nil
|
||||
}
|
||||
|
||||
p.Type = channel.Type
|
||||
if p.Type == discordgo.ChannelTypeDM {
|
||||
p.DMUser = channel.Recipients[0].ID
|
||||
}
|
||||
|
||||
p.roomCreateLock.Lock()
|
||||
defer p.roomCreateLock.Unlock()
|
||||
|
||||
// If we have a matrix id the room should exist so we have nothing to do.
|
||||
if p.MXID != "" {
|
||||
return nil
|
||||
|
||||
@@ -374,6 +374,10 @@ func (u *User) channelCreateHandler(s *discordgo.Session, c *discordgo.ChannelCr
|
||||
key := database.NewPortalKey(c.ID, u.User.ID)
|
||||
portal := u.bridge.GetPortalByID(key)
|
||||
|
||||
if portal.MXID != "" {
|
||||
return
|
||||
}
|
||||
|
||||
portal.Name = c.Name
|
||||
portal.Topic = c.Topic
|
||||
portal.Type = c.Type
|
||||
|
||||
Reference in New Issue
Block a user