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/slack/slack.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'bridge/slack') diff --git a/bridge/slack/slack.go b/bridge/slack/slack.go index 6617f823..4c72a90c 100644 --- a/bridge/slack/slack.go +++ b/bridge/slack/slack.go @@ -127,6 +127,9 @@ func (b *Bslack) JoinChannel(channel string) error { func (b *Bslack) Send(msg config.Message) error { flog.Debugf("Receiving %#v", msg) + if msg.Event == config.EVENT_USER_ACTION { + msg.Text = "_" + msg.Text + "_" + } nick := msg.Username message := msg.Text channel := msg.Channel @@ -231,6 +234,9 @@ func (b *Bslack) handleSlack() { text = html.UnescapeString(text) flog.Debugf("Sending message from %s on %s to gateway", message.Username, b.Account) msg := config.Message{Text: text, Username: message.Username, Channel: message.Channel, Account: b.Account, Avatar: b.getAvatar(message.Username), UserID: message.UserID} + if message.Raw.SubType == "me_message" { + msg.Event = config.EVENT_USER_ACTION + } b.Remote <- msg } } -- cgit v1.2.3