summaryrefslogtreecommitdiffstats
path: root/bridge/slack/slack.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-06-18 15:44:54 +0200
committerWim <wim@42.be>2017-06-18 15:44:54 +0200
commit2ddc4f7ae91a51bc8fa279fdab3c7d64600e1a25 (patch)
tree060c4b14360809d4981cbf3b3b6701e84c48af54 /bridge/slack/slack.go
parent2dd402675d774eec8a3d4b062afb6a5eaf6f884c (diff)
downloadmatterbridge-msglm-2ddc4f7ae91a51bc8fa279fdab3c7d64600e1a25.tar.gz
matterbridge-msglm-2ddc4f7ae91a51bc8fa279fdab3c7d64600e1a25.tar.bz2
matterbridge-msglm-2ddc4f7ae91a51bc8fa279fdab3c7d64600e1a25.zip
Add UserID to each message. Closes #200
Diffstat (limited to 'bridge/slack/slack.go')
-rw-r--r--bridge/slack/slack.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/bridge/slack/slack.go b/bridge/slack/slack.go
index eb08500c..fd4b9e1a 100644
--- a/bridge/slack/slack.go
+++ b/bridge/slack/slack.go
@@ -15,6 +15,7 @@ type MMMessage struct {
Text string
Channel string
Username string
+ UserID string
Raw *slack.MessageEvent
}
@@ -185,7 +186,7 @@ func (b *Bslack) handleSlack() {
texts := strings.Split(message.Text, "\n")
for _, text := range texts {
flog.Debugf("Sending message from %s on %s to gateway", message.Username, b.Account)
- b.Remote <- config.Message{Text: text, Username: message.Username, Channel: message.Channel, Account: b.Account, Avatar: b.getAvatar(message.Username)}
+ b.Remote <- config.Message{Text: text, Username: message.Username, Channel: message.Channel, Account: b.Account, Avatar: b.getAvatar(message.Username), UserID: message.UserID}
}
}
}
@@ -213,6 +214,7 @@ func (b *Bslack) handleSlackClient(mchan chan *MMMessage) {
continue
}
m := &MMMessage{}
+ m.UserID = user.ID
m.Username = user.Name
m.Channel = channel.Name
m.Text = ev.Text