diff options
Diffstat (limited to 'gateway/handlers.go')
-rw-r--r-- | gateway/handlers.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gateway/handlers.go b/gateway/handlers.go index 74bf4334..26d3f189 100644 --- a/gateway/handlers.go +++ b/gateway/handlers.go @@ -14,6 +14,7 @@ import ( "github.com/42wim/matterbridge/bridge" "github.com/42wim/matterbridge/bridge/config" + "github.com/42wim/matterbridge/gateway/bridgemap" ) // handleEventFailure handles failures and reconnects bridges. @@ -190,6 +191,14 @@ func (gw *Gateway) ignoreEvent(event string, dest *bridge.Bridge) bool { func (gw *Gateway) handleMessage(rmsg *config.Message, dest *bridge.Bridge) []*BrMsgID { var brMsgIDs []*BrMsgID + // Not all bridges support "user is typing" indications so skip the message + // if the targeted bridge does not support it. + if rmsg.Event == config.EventUserTyping { + if _, ok := bridgemap.UserTypingSupport[dest.Protocol]; !ok { + return nil + } + } + // if we have an attached file, or other info if rmsg.Extra != nil && len(rmsg.Extra[config.EventFileFailureSize]) != 0 && rmsg.Text == "" { return brMsgIDs |