summaryrefslogtreecommitdiffstats
path: root/bridge/discord/helpers.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2020-01-09 23:54:04 +0100
committerGitHub <noreply@github.com>2020-01-09 23:54:04 +0100
commit4c44515f9df8eb0eb67116f05cb50820d800f961 (patch)
tree313fea6f4c4be1b2388d48478021b43f174901c3 /bridge/discord/helpers.go
parent9d84d6dd643c4017074e81465671cd9b25f9539a (diff)
downloadmatterbridge-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/helpers.go')
-rw-r--r--bridge/discord/helpers.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/bridge/discord/helpers.go b/bridge/discord/helpers.go
index c094e47a..7ea0a365 100644
--- a/bridge/discord/helpers.go
+++ b/bridge/discord/helpers.go
@@ -96,6 +96,13 @@ func (b *Bdiscord) getChannelName(id string) string {
b.channelsMutex.RLock()
defer b.channelsMutex.RUnlock()
+ for _, c := range b.channelInfoMap {
+ if c.Name == "ID:"+id {
+ // if we have ID: specified in our gateway configuration return this
+ return c.Name
+ }
+ }
+
for _, channel := range b.channels {
if channel.ID == id {
return b.getCategoryChannelName(channel.Name, channel.ParentID)