summaryrefslogtreecommitdiffstats
path: root/bridge/mattermost/mattermost.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-04-15 20:21:57 +0200
committerWim <wim@42.be>2017-04-15 20:21:57 +0200
commitfdb57230a363d1326f597253bb230f0e7e325aee (patch)
tree58af49c8d900f1b43a61528d6360188ef296007b /bridge/mattermost/mattermost.go
parent7469732bbc84dbb60b6eafc29fb8d0771a48ba27 (diff)
downloadmatterbridge-msglm-fdb57230a363d1326f597253bb230f0e7e325aee.tar.gz
matterbridge-msglm-fdb57230a363d1326f597253bb230f0e7e325aee.tar.bz2
matterbridge-msglm-fdb57230a363d1326f597253bb230f0e7e325aee.zip
Add support for edited messages (mattermost)
Diffstat (limited to 'bridge/mattermost/mattermost.go')
-rw-r--r--bridge/mattermost/mattermost.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/bridge/mattermost/mattermost.go b/bridge/mattermost/mattermost.go
index b9d082e3..31c8b603 100644
--- a/bridge/mattermost/mattermost.go
+++ b/bridge/mattermost/mattermost.go
@@ -143,12 +143,16 @@ func (b *Bmattermost) handleMatterClient(mchan chan *MMMessage) {
}
// do not post our own messages back to irc
// only listen to message from our team
- if message.Raw.Event == "posted" && b.mc.User.Username != message.Username && message.Raw.Data["team_id"].(string) == b.TeamId {
+ if (message.Raw.Event == "posted" || message.Raw.Event == "post_edited") &&
+ b.mc.User.Username != message.Username && message.Raw.Data["team_id"].(string) == b.TeamId {
flog.Debugf("Receiving from matterclient %#v", message)
m := &MMMessage{}
m.Username = message.Username
m.Channel = message.Channel
m.Text = message.Text
+ if message.Raw.Event == "post_edited" && !b.Config.EditDisable {
+ m.Text = message.Text + b.Config.EditSuffix
+ }
if len(message.Post.FileIds) > 0 {
for _, link := range b.mc.GetPublicLinks(message.Post.FileIds) {
m.Text = m.Text + "\n" + link