diff options
author | Wim <wim@42.be> | 2018-08-06 16:44:15 +0200 |
---|---|---|
committer | Wim <wim@42.be> | 2018-08-06 16:44:15 +0200 |
commit | d71850cef6e72f662b6fda14c773ffdefe49c730 (patch) | |
tree | ac9bf8125d4a6353c6eff60d3490f374373f0c9f /bridge/slack/slack.go | |
parent | 2597c9bfacfbc04d1d77162465039eb9b45d0e4d (diff) | |
download | matterbridge-msglm-d71850cef6e72f662b6fda14c773ffdefe49c730.tar.gz matterbridge-msglm-d71850cef6e72f662b6fda14c773ffdefe49c730.tar.bz2 matterbridge-msglm-d71850cef6e72f662b6fda14c773ffdefe49c730.zip |
Use UserID to look for avatar instead of username (slack). Closes #472
Diffstat (limited to 'bridge/slack/slack.go')
-rw-r--r-- | bridge/slack/slack.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bridge/slack/slack.go b/bridge/slack/slack.go index f2428005..a38d1eef 100644 --- a/bridge/slack/slack.go +++ b/bridge/slack/slack.go @@ -223,11 +223,11 @@ func (b *Bslack) Reload(cfg *bridge.Config) (string, error) { return "", nil } -func (b *Bslack) getAvatar(user string) string { +func (b *Bslack) getAvatar(userid string) string { var avatar string if b.Users != nil { for _, u := range b.Users { - if user == u.Name { + if userid == u.ID { return u.Profile.Image48 } } @@ -283,7 +283,7 @@ func (b *Bslack) handleSlack() { message.Text = html.UnescapeString(message.Text) // Add the avatar - message.Avatar = b.getAvatar(strings.ToLower(message.Username)) + message.Avatar = b.getAvatar(message.UserID) b.Log.Debugf("<= Message is %#v", message) b.Remote <- *message |