summaryrefslogtreecommitdiffstats
path: root/matterbridge.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2015-11-29 00:28:10 +0100
committerWim <wim@42.be>2015-11-29 00:28:10 +0100
commitbd7c1e3e3c7fa92c4f1ad7ab296ffc819d54aab8 (patch)
tree53f07e593b95331da7c7b368bb55544930148b78 /matterbridge.go
parent5c1b02c7a31c8f9d1bc68a5530dcddaeaf8b56b5 (diff)
downloadmatterbridge-msglm-bd7c1e3e3c7fa92c4f1ad7ab296ffc819d54aab8.tar.gz
matterbridge-msglm-bd7c1e3e3c7fa92c4f1ad7ab296ffc819d54aab8.tar.bz2
matterbridge-msglm-bd7c1e3e3c7fa92c4f1ad7ab296ffc819d54aab8.zip
Set type join_leave for irc JOIN/PART messages send to mattermostv0.2
Diffstat (limited to 'matterbridge.go')
-rw-r--r--matterbridge.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/matterbridge.go b/matterbridge.go
index 8e669c54..1ab3eacd 100644
--- a/matterbridge.go
+++ b/matterbridge.go
@@ -56,7 +56,7 @@ func (b *Bridge) handlePrivMsg(event *irc.Event) {
}
func (b *Bridge) handleJoinPart(event *irc.Event) {
- b.Send(b.Config.IRC.Nick, "irc-"+event.Nick+" "+strings.ToLower(event.Code)+"s "+event.Message())
+ b.SendType(b.Config.IRC.Nick, "irc-"+event.Nick+" "+strings.ToLower(event.Code)+"s "+event.Message(), "join_leave")
}
func (b *Bridge) handleOther(event *irc.Event) {
@@ -67,9 +67,14 @@ func (b *Bridge) handleOther(event *irc.Event) {
}
func (b *Bridge) Send(nick string, message string) error {
+ return b.SendType(nick, message, "")
+}
+
+func (b *Bridge) SendType(nick string, message string, mtype string) error {
matterMessage := matterhook.OMessage{IconURL: b.Config.Mattermost.IconURL}
matterMessage.UserName = nick
matterMessage.Text = message
+ matterMessage.Type = mtype
err := b.m.Send(matterMessage)
if err != nil {
log.Println(err)