summaryrefslogtreecommitdiffstats
path: root/bridge/slack
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/slack
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/slack')
-rw-r--r--bridge/slack/slack.go6
1 files changed, 6 insertions, 0 deletions
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
}
}