diff options
author | Wim <wim@42.be> | 2019-02-23 16:35:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-23 16:35:54 +0100 |
commit | 3190703dc8618896c932a23d8ca155fbbf6fab13 (patch) | |
tree | ab49eb5adbe6b59945dd2b21cb378ffb7538add9 /gateway/gateway.go | |
parent | 5095db8a43491fd2c5859f25cbb89a3be40bef6d (diff) | |
download | matterbridge-msglm-3190703dc8618896c932a23d8ca155fbbf6fab13.tar.gz matterbridge-msglm-3190703dc8618896c932a23d8ca155fbbf6fab13.tar.bz2 matterbridge-msglm-3190703dc8618896c932a23d8ca155fbbf6fab13.zip |
Support rewriting messages from relaybots using ExtractNicks. Fixes #466 (#730)
some examples:
this replaces a message like "Relaybot: <relayeduser> something interesting" to "relayeduser: something interesting"
ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ] ]
you can use multiple entries for multiplebots
this also replaces a message like "otherbot: (relayeduser) something else" to "relayeduser: something else"
ExtractNicks=[ [ "Relaybot", "<(.*?)>\\s+" ],[ "otherbot","\\((.*?)\\)\\s+" ]
OPTIONAL (default empty)
ExtractNicks=[ ["otherbot","<(.*?)>\\s+" ] ]
Diffstat (limited to 'gateway/gateway.go')
-rw-r--r-- | gateway/gateway.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gateway/gateway.go b/gateway/gateway.go index 0c04a167..2f797734 100644 --- a/gateway/gateway.go +++ b/gateway/gateway.go @@ -351,6 +351,8 @@ func (gw *Gateway) modifyMessage(msg *config.Message) { msg.Text = re.ReplaceAllString(msg.Text, replace) } + gw.handleExtractNicks(msg) + // messages from api have Gateway specified, don't overwrite if msg.Protocol != apiProtocol { msg.Gateway = gw.Name |