diff options
author | Wim <wim@42.be> | 2020-01-09 23:54:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-09 23:54:04 +0100 |
commit | 4c44515f9df8eb0eb67116f05cb50820d800f961 (patch) | |
tree | 313fea6f4c4be1b2388d48478021b43f174901c3 /bridge/discord/handlers.go | |
parent | 9d84d6dd643c4017074e81465671cd9b25f9539a (diff) | |
download | matterbridge-msglm-4c44515f9df8eb0eb67116f05cb50820d800f961.tar.gz matterbridge-msglm-4c44515f9df8eb0eb67116f05cb50820d800f961.tar.bz2 matterbridge-msglm-4c44515f9df8eb0eb67116f05cb50820d800f961.zip |
Fix channel ID problem with multiple gateways (discord). Fixes #953 (#977)
Diffstat (limited to 'bridge/discord/handlers.go')
-rw-r--r-- | bridge/discord/handlers.go | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/bridge/discord/handlers.go b/bridge/discord/handlers.go index c86a9e8d..ab320975 100644 --- a/bridge/discord/handlers.go +++ b/bridge/discord/handlers.go @@ -8,9 +8,7 @@ import ( func (b *Bdiscord) messageDelete(s *discordgo.Session, m *discordgo.MessageDelete) { //nolint:unparam rmsg := config.Message{Account: b.Account, ID: m.ID, Event: config.EventMsgDelete, Text: config.EventMsgDelete} rmsg.Channel = b.getChannelName(m.ChannelID) - if b.useChannelID { - rmsg.Channel = "ID:" + m.ChannelID - } + b.Log.Debugf("<= Sending message from %s to gateway", b.Account) b.Log.Debugf("<= Message is %#v", rmsg) b.Remote <- rmsg @@ -24,11 +22,7 @@ func (b *Bdiscord) messageDeleteBulk(s *discordgo.Session, m *discordgo.MessageD ID: msgID, Event: config.EventMsgDelete, Text: config.EventMsgDelete, - Channel: "ID:" + m.ChannelID, - } - - if !b.useChannelID { - rmsg.Channel = b.getChannelName(m.ChannelID) + Channel: b.getChannelName(m.ChannelID), } b.Log.Debugf("<= Sending message from %s to gateway", b.Account) @@ -44,9 +38,6 @@ func (b *Bdiscord) messageTyping(s *discordgo.Session, m *discordgo.TypingStart) rmsg := config.Message{Account: b.Account, Event: config.EventUserTyping} rmsg.Channel = b.getChannelName(m.ChannelID) - if b.useChannelID { - rmsg.Channel = "ID:" + m.ChannelID - } b.Remote <- rmsg } @@ -98,9 +89,6 @@ func (b *Bdiscord) messageCreate(s *discordgo.Session, m *discordgo.MessageCreat // set channel name rmsg.Channel = b.getChannelName(m.ChannelID) - if b.useChannelID { - rmsg.Channel = "ID:" + m.ChannelID - } // set username if !b.GetBool("UseUserName") { |