diff options
author | Wim <wim@42.be> | 2017-06-18 15:44:54 +0200 |
---|---|---|
committer | Wim <wim@42.be> | 2017-06-18 15:44:54 +0200 |
commit | 2ddc4f7ae91a51bc8fa279fdab3c7d64600e1a25 (patch) | |
tree | 060c4b14360809d4981cbf3b3b6701e84c48af54 /bridge/mattermost/mattermost.go | |
parent | 2dd402675d774eec8a3d4b062afb6a5eaf6f884c (diff) | |
download | matterbridge-msglm-2ddc4f7ae91a51bc8fa279fdab3c7d64600e1a25.tar.gz matterbridge-msglm-2ddc4f7ae91a51bc8fa279fdab3c7d64600e1a25.tar.bz2 matterbridge-msglm-2ddc4f7ae91a51bc8fa279fdab3c7d64600e1a25.zip |
Add UserID to each message. Closes #200
Diffstat (limited to 'bridge/mattermost/mattermost.go')
-rw-r--r-- | bridge/mattermost/mattermost.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bridge/mattermost/mattermost.go b/bridge/mattermost/mattermost.go index 3db880ba..e88bf838 100644 --- a/bridge/mattermost/mattermost.go +++ b/bridge/mattermost/mattermost.go @@ -21,6 +21,7 @@ type MMMessage struct { Text string Channel string Username string + UserID string } type Bmattermost struct { @@ -127,7 +128,7 @@ func (b *Bmattermost) handleMatter() { } for message := range mchan { flog.Debugf("Sending message from %s on %s to gateway", message.Username, b.Account) - b.Remote <- config.Message{Text: message.Text, Username: message.Username, Channel: message.Channel, Account: b.Account} + b.Remote <- config.Message{Text: message.Text, Username: message.Username, Channel: message.Channel, Account: b.Account, UserID: message.UserID} } } @@ -150,6 +151,7 @@ func (b *Bmattermost) handleMatterClient(mchan chan *MMMessage) { b.mc.User.Username != message.Username && message.Raw.Data["team_id"].(string) == b.TeamId { flog.Debugf("Receiving from matterclient %#v", message) m := &MMMessage{} + m.UserID = message.UserID m.Username = message.Username m.Channel = message.Channel m.Text = message.Text @@ -171,6 +173,7 @@ func (b *Bmattermost) handleMatterHook(mchan chan *MMMessage) { message := b.mh.Receive() flog.Debugf("Receiving from matterhook %#v", message) m := &MMMessage{} + m.UserID = message.UserID m.Username = message.UserName m.Text = message.Text m.Channel = message.ChannelName |