From f8e6a69d6e8453de0b700b6e9a3eedeec0b1f0a5 Mon Sep 17 00:00:00 2001 From: Wim Date: Sun, 30 Jul 2017 17:48:23 +0200 Subject: Add action support for slack,mattermost,irc,gitter,matrix,xmpp,discord. #199 --- bridge/gitter/gitter.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'bridge/gitter') 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) -- cgit v1.2.3