diff options
Diffstat (limited to 'gateway/router.go')
-rw-r--r-- | gateway/router.go | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/gateway/router.go b/gateway/router.go index 26c09968..eb8251ed 100644 --- a/gateway/router.go +++ b/gateway/router.go @@ -70,13 +70,14 @@ func (r *Router) getBridge(account string) *bridge.Bridge { return nil } -func (r *Router) getGatewayName(channelID string) string { +func (r *Router) getGatewayName(channelID string) []string { + var names []string for _, gw := range r.Gateways { if _, ok := gw.Channels[channelID]; ok { - return gw.Name + names = append(names, gw.Name) } } - return "" + return names } func (r *Router) handleReceive() { @@ -103,13 +104,11 @@ func (r *Router) handleReceive() { } } for _, gw := range r.Gateways { - if gw.Name == r.getGatewayName(getChannelID(msg)) { - if !gw.ignoreMessage(&msg) { - msg.Timestamp = time.Now() - gw.modifyMessage(&msg) - for _, br := range gw.Bridges { - gw.handleMessage(msg, br) - } + if !gw.ignoreMessage(&msg) { + msg.Timestamp = time.Now() + gw.modifyMessage(&msg) + for _, br := range gw.Bridges { + gw.handleMessage(msg, br) } } } |