diff options
author | Patrick Connolly <patrick.c.connolly@gmail.com> | 2018-11-09 03:45:40 +0800 |
---|---|---|
committer | Wim <wim@42.be> | 2018-11-08 20:45:40 +0100 |
commit | 3d281b3316a68a265efb0f024755e8d1c3863bd5 (patch) | |
tree | 55c6f428b23a3857a7f45263769a84acf633c130 /bridge/slack/slack.go | |
parent | ea86849a5855e58fd4633117416a21fde753751f (diff) | |
download | matterbridge-msglm-3d281b3316a68a265efb0f024755e8d1c3863bd5.tar.gz matterbridge-msglm-3d281b3316a68a265efb0f024755e8d1c3863bd5.tar.bz2 matterbridge-msglm-3d281b3316a68a265efb0f024755e8d1c3863bd5.zip |
Add ability to show when user is typing across Slack bridges (#559)
Diffstat (limited to 'bridge/slack/slack.go')
-rw-r--r-- | bridge/slack/slack.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/bridge/slack/slack.go b/bridge/slack/slack.go index 8c96837e..701f4769 100644 --- a/bridge/slack/slack.go +++ b/bridge/slack/slack.go @@ -187,7 +187,10 @@ func (b *Bslack) Reload(cfg *bridge.Config) (string, error) { } func (b *Bslack) Send(msg config.Message) (string, error) { - b.Log.Debugf("=> Receiving %#v", msg) + // Too noisy to log like other events + if msg.Event != config.EVENT_USER_TYPING { + b.Log.Debugf("=> Receiving %#v", msg) + } // Make a action /me of the message if msg.Event == config.EVENT_USER_ACTION { @@ -266,6 +269,12 @@ func (b *Bslack) sendRTM(msg config.Message) (string, error) { if err != nil { return "", fmt.Errorf("could not send message: %v", err) } + if msg.Event == config.EVENT_USER_TYPING { + if b.GetBool("ShowUserTyping") { + b.rtm.SendMessage(b.rtm.NewTypingMessage(channelInfo.ID)) + } + return "", nil + } // Delete message if msg.Event == config.EVENT_MSG_DELETE { |