Properly handle group dm name updates.

Refs #37
This commit is contained in:
Gary Kramlich
2022-04-29 07:32:28 -05:00
parent 218854a427
commit 59ea003f51

View File

@@ -411,6 +411,17 @@ func (p *Portal) handleDiscordMessageCreate(user *User, msg *discordgo.Message)
return
}
// Handle room name changes
if msg.Type == discordgo.MessageTypeChannelNameChange {
p.Name = msg.Content
p.Update()
p.MainIntent().SetRoomName(p.MXID, msg.Content)
return
}
// Handle normal message
existing := p.bridge.db.Message.GetByDiscordID(p.Key, msg.ID)
if existing != nil {
p.log.Debugln("not handling duplicate message", msg.ID)