Ignore edited messages with reactions (mattermost)

This commit is contained in:
Wim 2017-07-25 23:19:50 +02:00
parent 5b191f78a0
commit ba653c0841

View File

@ -174,6 +174,10 @@ func (b *Bmattermost) handleMatterClient(mchan chan *MMMessage) {
// only listen to message from our team // only listen to message from our team
if (message.Raw.Event == "posted" || message.Raw.Event == "post_edited") && if (message.Raw.Event == "posted" || message.Raw.Event == "post_edited") &&
b.mc.User.Username != message.Username && message.Raw.Data["team_id"].(string) == b.TeamId { b.mc.User.Username != message.Username && message.Raw.Data["team_id"].(string) == b.TeamId {
// if the message has reactions don't repost it (for now, until we can correlate reaction with message)
if message.Post.HasReactions {
continue
}
flog.Debugf("Receiving from matterclient %#v", message) flog.Debugf("Receiving from matterclient %#v", message)
m := &MMMessage{} m := &MMMessage{}
m.UserID = message.UserID m.UserID = message.UserID