From 3d281b3316a68a265efb0f024755e8d1c3863bd5 Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Fri, 9 Nov 2018 03:45:40 +0800 Subject: Add ability to show when user is typing across Slack bridges (#559) --- gateway/gateway.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'gateway') diff --git a/gateway/gateway.go b/gateway/gateway.go index d4c84650..3a6fa1e0 100644 --- a/gateway/gateway.go +++ b/gateway/gateway.go @@ -297,7 +297,11 @@ func (gw *Gateway) handleMessage(msg config.Message, dest *bridge.Bridge) []*BrM continue } } - flog.Debugf("=> Sending %#v from %s (%s) to %s (%s)", msg, msg.Account, originchannel, dest.Account, channel.Name) + + // Too noisy to log like other events + if msg.Event != config.EVENT_USER_TYPING { + flog.Debugf("=> Sending %#v from %s (%s) to %s (%s)", msg, msg.Account, originchannel, dest.Account, channel.Name) + } msg.Channel = channel.Name msg.Avatar = gw.modifyAvatar(origmsg, dest) @@ -337,6 +341,9 @@ func (gw *Gateway) ignoreMessage(msg *config.Message) bool { // check if we need to ignore a empty message if msg.Text == "" { + if msg.Event == config.EVENT_USER_TYPING { + return false + } // we have an attachment or actual bytes, do not ignore if msg.Extra != nil && (msg.Extra["attachments"] != nil || -- cgit v1.2.3