4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-07-02 13:56:18 +00:00

Add ability to show when user is typing across Slack bridges (#559)

This commit is contained in:
Patrick Connolly
2018-11-09 03:45:40 +08:00
committed by Wim
parent ea86849a58
commit 3d281b3316
5 changed files with 55 additions and 3 deletions

View File

@ -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 {