From 2e4d58cb921afe074e761285b311963ba5f358c6 Mon Sep 17 00:00:00 2001 From: Wim Date: Tue, 28 Mar 2017 23:56:58 +0200 Subject: Refactor --- gateway/samechannel/samechannel.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gateway/samechannel') diff --git a/gateway/samechannel/samechannel.go b/gateway/samechannel/samechannel.go index 47bdfca1..22f37e67 100644 --- a/gateway/samechannel/samechannel.go +++ b/gateway/samechannel/samechannel.go @@ -41,9 +41,11 @@ func (sgw *SameChannelGateway) validChannel(channel string) bool { return false } -func (sgw *SameChannelGateway) getDestChannel(msg *config.Message, dest string) []string { +func (sgw *SameChannelGateway) getDestChannel(msg *config.Message, dest string) []config.ChannelInfo { + var channels []config.ChannelInfo if sgw.validChannel(msg.Channel) { - return []string{msg.Channel} + channels = append(channels, config.ChannelInfo{Name: msg.Channel, Account: dest, ID: msg.Channel + dest}) + return channels } - return []string{} + return channels } -- cgit v1.2.3