diff options
author | Jerry Heiselman <jheiselman@users.noreply.github.com> | 2018-04-25 14:27:34 -0500 |
---|---|---|
committer | Wim <wim@42.be> | 2018-04-25 21:27:34 +0200 |
commit | 76af9cba5a28b0879751c6ec7254b4454d9da40f (patch) | |
tree | bc4c5bcb8b0a80eb9cd669df77deab3b10ce700a /bridge/slack/slack.go | |
parent | b69fc30902a43cf4fe19e951a4512cad964ac335 (diff) | |
download | matterbridge-msglm-76af9cba5a28b0879751c6ec7254b4454d9da40f.tar.gz matterbridge-msglm-76af9cba5a28b0879751c6ec7254b4454d9da40f.tar.bz2 matterbridge-msglm-76af9cba5a28b0879751c6ec7254b4454d9da40f.zip |
Properly set Slack user who initiated slash command (#394)
* Properly set Slack user who initiated slash command
Diffstat (limited to 'bridge/slack/slack.go')
-rw-r--r-- | bridge/slack/slack.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bridge/slack/slack.go b/bridge/slack/slack.go index 0abd83c3..95c85158 100644 --- a/bridge/slack/slack.go +++ b/bridge/slack/slack.go @@ -485,7 +485,7 @@ func (b *Bslack) handleMessageEvent(ev *slack.MessageEvent) (*config.Message, er rmsg := config.Message{Text: ev.Text, Channel: channel.Name, Account: b.Account, ID: "slack " + ev.Timestamp, Extra: make(map[string][]interface{})} // find the user id and name - if ev.BotID == "" && ev.SubType != messageDeleted && ev.SubType != "file_comment" { + if ev.User != "" && ev.SubType != messageDeleted && ev.SubType != "file_comment" { user, err := b.rtm.GetUserInfo(ev.User) if err != nil { return nil, err @@ -509,7 +509,7 @@ func (b *Bslack) handleMessageEvent(ev *slack.MessageEvent) (*config.Message, er } // when using webhookURL we can't check if it's our webhook or not for now - if ev.BotID != "" && b.GetString("WebhookURL") == "" { + if rmsg.Username == "" && ev.BotID != "" && b.GetString("WebhookURL") == "" { bot, err := b.rtm.GetBotInfo(ev.BotID) if err != nil { return nil, err |