diff options
author | Wim <wim@42.be> | 2018-04-21 23:26:39 +0200 |
---|---|---|
committer | Wim <wim@42.be> | 2018-04-21 23:26:39 +0200 |
commit | b69fc30902a43cf4fe19e951a4512cad964ac335 (patch) | |
tree | 9343d3b2f9a565929c128a422fcc6d834c8a912a | |
parent | c3174f4de9ae60f2213f7ecdb9f3fac57925eadd (diff) | |
download | matterbridge-msglm-b69fc30902a43cf4fe19e951a4512cad964ac335.tar.gz matterbridge-msglm-b69fc30902a43cf4fe19e951a4512cad964ac335.tar.bz2 matterbridge-msglm-b69fc30902a43cf4fe19e951a4512cad964ac335.zip |
Fix regression in ReplaceMessages and ReplaceNicks. Closes #407
-rw-r--r-- | bridge/config/config.go | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/bridge/config/config.go b/bridge/config/config.go index 0a8bbc1b..09f15c2e 100644 --- a/bridge/config/config.go +++ b/bridge/config/config.go @@ -243,11 +243,18 @@ func (c *Config) GetStringSlice(key string) []string { func (c *Config) GetStringSlice2D(key string) [][]string { c.RLock() defer c.RUnlock() - if res, ok := c.v.Get(key).([][]string); ok { - return res + result := [][]string{} + if res, ok := c.v.Get(key).([]interface{}); ok { + for _, entry := range res { + result2 := []string{} + for _, entry2 := range entry.([]interface{}) { + result2 = append(result2, entry2.(string)) + } + result = append(result, result2) + } + return result } - // log.Debugf("getting StringSlice2D %s = %#v", key, c.v.Get(key)) - return [][]string{} + return result } func GetIconURL(msg *Message, iconURL string) string { |