summaryrefslogtreecommitdiffstats
path: root/bridge/gitter
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-07-30 17:48:23 +0200
committerWim <wim@42.be>2017-07-30 17:48:23 +0200
commitf8e6a69d6e8453de0b700b6e9a3eedeec0b1f0a5 (patch)
tree7ac1bc3a4c0d0429cf01adcedd2ae0422d6963cd /bridge/gitter
parent54216cec4b4f2023306e378587b1ac55dc720968 (diff)
downloadmatterbridge-msglm-f8e6a69d6e8453de0b700b6e9a3eedeec0b1f0a5.tar.gz
matterbridge-msglm-f8e6a69d6e8453de0b700b6e9a3eedeec0b1f0a5.tar.bz2
matterbridge-msglm-f8e6a69d6e8453de0b700b6e9a3eedeec0b1f0a5.zip
Add action support for slack,mattermost,irc,gitter,matrix,xmpp,discord. #199
Diffstat (limited to 'bridge/gitter')
-rw-r--r--bridge/gitter/gitter.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/bridge/gitter/gitter.go b/bridge/gitter/gitter.go
index 973a7300..0b8667ea 100644
--- a/bridge/gitter/gitter.go
+++ b/bridge/gitter/gitter.go
@@ -81,8 +81,13 @@ func (b *Bgitter) JoinChannel(channel string) error {
// check for ZWSP to see if it's not an echo
if !strings.HasSuffix(ev.Message.Text, "​") {
flog.Debugf("Sending message from %s on %s to gateway", ev.Message.From.Username, b.Account)
- b.Remote <- config.Message{Username: ev.Message.From.Username, Text: ev.Message.Text, Channel: room,
+ rmsg := config.Message{Username: ev.Message.From.Username, Text: ev.Message.Text, Channel: room,
Account: b.Account, Avatar: b.getAvatar(ev.Message.From.Username), UserID: ev.Message.From.ID}
+ if strings.HasPrefix(ev.Message.Text, "@"+ev.Message.From.Username) {
+ rmsg.Event = config.EVENT_USER_ACTION
+ rmsg.Text = strings.Replace(rmsg.Text, "@"+ev.Message.From.Username+" ", "", -1)
+ }
+ b.Remote <- rmsg
}
case *gitter.GitterConnectionClosed:
flog.Errorf("connection with gitter closed for room %s", room)