Use override username if specified (mattermost). #260

This commit is contained in:
Wim 2017-09-18 21:18:31 +02:00
parent 603449e850
commit 82588b00c5

View File

@ -220,6 +220,12 @@ func (b *Bmattermost) handleMatterClient(mchan chan *MMMessage) {
if (message.Raw.Event == "post_edited") && b.Config.EditDisable { if (message.Raw.Event == "post_edited") && b.Config.EditDisable {
continue continue
} }
props := message.Post.Props
if props != nil {
if _, ok := props["override_username"].(string); ok {
message.Username = props["override_username"].(string)
}
}
// do not post our own messages back to irc // do not post our own messages back to irc
// only listen to message from our team // only listen to message from our team
if (message.Raw.Event == "posted" || message.Raw.Event == "post_edited" || message.Raw.Event == "post_deleted") && if (message.Raw.Event == "posted" || message.Raw.Event == "post_edited" || message.Raw.Event == "post_deleted") &&