summaryrefslogtreecommitdiffstats
path: root/bridge/slack/helpers.go
diff options
context:
space:
mode:
authorPatrick Connolly <patrick.c.connolly@gmail.com>2018-10-25 03:12:20 +0800
committerWim <wim@42.be>2018-10-24 21:12:20 +0200
commitd379118772aa68d0b35bb5a98b5600dc81a89197 (patch)
tree5ced65932b4f2af31c7d68195bb87998f353a472 /bridge/slack/helpers.go
parent291594b99ceb56b5da354bd093b6a04f43e24d4e (diff)
downloadmatterbridge-msglm-d379118772aa68d0b35bb5a98b5600dc81a89197.tar.gz
matterbridge-msglm-d379118772aa68d0b35bb5a98b5600dc81a89197.tar.bz2
matterbridge-msglm-d379118772aa68d0b35bb5a98b5600dc81a89197.zip
Fix bridge no longer POSTing username and avatar (slack) (#536)
* Fixed pointer/reference issue in populateUsers. [#536] * Accepted codestyle suggestion. * Update bridge/slack/helpers.go Co-Authored-By: patcon <patrick.c.connolly@gmail.com> * Update helpers.go
Diffstat (limited to 'bridge/slack/helpers.go')
-rw-r--r--bridge/slack/helpers.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/bridge/slack/helpers.go b/bridge/slack/helpers.go
index 18dded3b..8508d152 100644
--- a/bridge/slack/helpers.go
+++ b/bridge/slack/helpers.go
@@ -65,8 +65,10 @@ func (b *Bslack) populateUsers() {
}
newUsers := map[string]*slack.User{}
- for _, user := range users {
- newUsers[user.ID] = &user
+ for i := range users {
+ // Use array index for pointer, not the copy
+ // See: https://stackoverflow.com/a/29498133/504018
+ newUsers[users[i].ID] = &users[i]
}
b.usersMutex.Lock()