From 82588b00c5e28ae3a8683410fd540c653469eb98 Mon Sep 17 00:00:00 2001 From: Wim Date: Mon, 18 Sep 2017 21:18:31 +0200 Subject: Use override username if specified (mattermost). #260 --- bridge/mattermost/mattermost.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'bridge') diff --git a/bridge/mattermost/mattermost.go b/bridge/mattermost/mattermost.go index 6e5b3d38..41a3f273 100644 --- a/bridge/mattermost/mattermost.go +++ b/bridge/mattermost/mattermost.go @@ -220,6 +220,12 @@ func (b *Bmattermost) handleMatterClient(mchan chan *MMMessage) { if (message.Raw.Event == "post_edited") && b.Config.EditDisable { 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 // only listen to message from our team if (message.Raw.Event == "posted" || message.Raw.Event == "post_edited" || message.Raw.Event == "post_deleted") && -- cgit v1.2.3