From 5ec94fdb4356df1be68a107f0ac142d44530b334 Mon Sep 17 00:00:00 2001 From: Fredrik de Vibe Date: Fri, 18 Mar 2016 06:09:29 -0400 Subject: Add config option to prefix messages (IRC->MM) with nick If username overriding isn't enabled on the Mattermost server, this is required for Mattermost users to see who sent a message from IRC. --- matterbridge.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'matterbridge.go') diff --git a/matterbridge.go b/matterbridge.go index 6cf4ea2d..4302cf17 100644 --- a/matterbridge.go +++ b/matterbridge.go @@ -92,8 +92,12 @@ func (b *Bridge) SendType(nick string, message string, channel string, mtype str matterMessage := matterhook.OMessage{IconURL: b.Config.Mattermost.IconURL} matterMessage.Channel = channel matterMessage.UserName = nick - matterMessage.Text = message matterMessage.Type = mtype + if (b.Config.IRC.PrefixMessagesWithNick) { + matterMessage.Text = nick + ": " + message + } else { + matterMessage.Text = message + } err := b.m.Send(matterMessage) if err != nil { log.Println(err) -- cgit v1.2.3