summaryrefslogtreecommitdiffstats
path: root/gateway/gateway.go
Commit message (Collapse)AuthorAgeFilesLines
* Add scripting (tengo) support for every outgoing message (#806)Wim2019-04-191-0/+45
| | | | | | | | | | | | | | | | | | Adds a new key OutMessage under [tengo] table, which specifies the location of the script that will be invoked on each message being sent to a bridge and can be used to modify the Username and the Text of that message. The script will have the following global variables: read-only: inAccount, inProtocol, inChannel, inGateway outAccount, outProtocol, outChannel, outGateway read-write: msgText, msgUsername The script is reloaded on every message, so you can modify the script on the fly. The default script in https://github.com/42wim/matterbridge/tree/master/internal/tengo/outmessage.tengo is compiled in and will be executed if no script is specified.
* Add tengo support to RemoteNickFormat (#793)Wim2019-04-081-0/+41
| | | | | | | | | | | | | | | | | | | This commit add support for using the result of a tengo script in RemoteNickFormat using {TENGO} Also adds a new toml table [tengo] with key RemoteNickFormat and value location of the script. This also moves the TengoModifyMessage from [general] to Message in [tengo] Documentation: RemoteNickFormat allows you to specify the location of a tengo (https://github.com/d5/tengo/) script. The script will have the following global variables: to modify: result to read: channel, bridge, gateway, protocol, nick The result will be set in {TENGO} in the RemoteNickFormat key of every bridge where {TENGO} is specified The script is reloaded on every message, so you can modify the script on the fly. Example script can be found in https://github.com/42wim/matterbridge/tree/master/contrib/remotenickformat.tengo [tengo] RemoteNickFormat="remotenickformat.tengo"
* Revert fix for #722. Closes #781Wim2019-04-061-17/+0
| | | | | | | | | | | | | | Revert "Fix typo" This reverts commit dffd67eb311580aa2b14e7f5a069cfefdbf3aacc. Revert "Handle quit message relay better on gateways with one channel on the irc bridge #722" This reverts commit 240559581a225ff632c00a52e029b3728c61309e. Revert "Support quits from irc correctly. Fixes #722 (#724)" This reverts commit d76a04bd0a96772cec5b279aaa1ee45235adc707.
* Update tengo vendor and load the stdlib. Fixes #789 (#792)Wim2019-04-061-0/+2
|
* Need to specify /topic:mytopic for channel configuration (zulip). (#751)Wim2019-03-021-0/+4
| | | | | | | | | | | | | | Breaking change for zulip channel configuration. For zulip the channel configuration will now need to specify also the topic with /topic:yourtopic. Example: [[gateway.inout]] account="zulip.streamchat" channel="general/topic:mytopic" This fixes the incorrect PR #701 which didn't work with multiple gateways.
* Fail gracefully on incorrect human input. Fixes #739 (#740)Wim2019-02-261-0/+3
|
* Make all loggers derive from non-default instance (#728)Wim2019-02-231-51/+73
|
* Add scripting (tengo) support for every incoming message (#731)Wim2019-02-231-0/+31
| | | | | | | | | | | | | | | | | | | | | | TengoModifyMessage allows you to specify the location of a tengo (https://github.com/d5/tengo/) script. This script will receive every incoming message and can be used to modify the Username and the Text of that message. The script will have the following global variables: to modify: msgUsername and msgText to read: msgChannel and msgAccount The script is reloaded on every message, so you can modify the script on the fly. Example script can be found in https://github.com/42wim/matterbridge/tree/master/gateway/bench.tengo and https://github.com/42wim/matterbridge/tree/master/contrib/example.tengo The example below will check if the text contains blah and if so, it'll replace the text and the username of that message. text := import("text") if text.re_match("blah",msgText) { msgText="replaced by this" msgUsername="fakeuser" } More information about tengo on: https://github.com/d5/tengo/blob/master/docs/tutorial.md and https://github.com/d5/tengo/blob/master/docs/stdlib.md
* Support rewriting messages from relaybots using ExtractNicks. Fixes #466 (#730)Wim2019-02-231-0/+2
| | | | | | | | | | 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+" ] ]
* Fix typoWim2019-02-211-1/+1
|
* Handle quit message relay better on gateways with one channel on the irc ↵Wim2019-02-211-0/+5
| | | | bridge #722
* Fix bug in #721Wim2019-02-171-2/+2
|
* Support quits from irc correctly. Fixes #722 (#724)Wim2019-02-171-1/+17
|
* Support join/leaves from discord. Closes #654 (#721)Wim2019-02-171-0/+12
|
* Allow regexs in ignoreNicks. Closes #690 (#720)Wim2019-02-171-33/+21
|
* Hint at thread replies when messages are unthreaded (slack) (#684)Wim2019-02-101-0/+6
|
* Fail if channel starts with hashtag (mattermost). Closes #625Wim2019-01-071-0/+5
|
* Use logrus imports instead of log (#662)Duco van Amstel2018-12-261-5/+5
|
* Refactor gateway (#648)Wim2018-12-121-205/+98
| | | | | | | * Decrease complexity of handleMessage, handleReceive, handleFiles * Move handlers to handlers.go * Split ignoreMessage up in ignoreTextEmpty, ignoreNicks and IgnoreTexts * Add ignoreEvent * Add testcase for ignoreTextEmpty, ignoreNicks, ignoreTexts and ignoreEvent
* Enable gosec linter (#645)Duco van Amstel2018-12-061-2/+2
|
* Tidy up fetching of config values. (#616)Patrick Connolly2018-12-011-12/+6
|
* Extract bridgeMap into own package to improve testability (#601)Patrick Connolly2018-11-301-31/+1
|
* Sync channel topics between Slack bridges (#585)Patrick Connolly2018-11-261-2/+4
| | | Added logic to allow for configurable synchronisation of topics and purposes of channels between Slack bridges.
* Add protocol to msg.ID in cache (#596)Wim2018-11-191-10/+10
|
* Fix golint linter issues and enable it in CI (#593)Duco van Amstel2018-11-151-22/+22
|
* Make config.Config more unit-test friendly (#586)Duco van Amstel2018-11-131-11/+14
|
* Add new Slack connection and forked legacy Slack bridge (#582)Duco van Amstel2018-11-131-21/+20
|
* Add support for mattermost matterbridge pluginWim2018-11-111-0/+6
|
* Make gochecknoinits linter happyWim2018-11-081-4/+1
|
* Make scopelint happyWim2018-11-081-0/+1
|
* Make goconst linter happyWim2018-11-081-4/+8
|
* Add ability to show when user is typing across Slack bridges (#559)Patrick Connolly2018-11-081-1/+8
|
* Make gocritic linter happyWim2018-11-081-1/+1
|
* Make unparam linter happyWim2018-11-081-2/+2
|
* Clean up various stuff (#508)David Hill2018-11-071-2/+2
| | | * various cleanups
* Preserve threading between Slack instances (#529)Patrick Connolly2018-11-071-11/+51
| | | | | | | | | | | | | | | | | | | | | | * Opportunistically preserve Slack threading when parent thread in cache. [#529] * Removed slack-specific processing from gateway. * Added docs. * Add option to enable threading, with default to off. * Did cleanup on @42wim's comments. * Update gateway/gateway.go Co-Authored-By: patcon <patrick.c.connolly@gmail.com> * Suggestion from @42wim :) * Suggestions from @42wim. * More suggestions.
* Allow origin CHANNEL to be used in RemoteNickFormat (#515)Patrick Connolly2018-10-231-0/+1
| | | | | | | | * Added origin CHANNEL to RemoteNickFormat. Updated config docs. [Fixes #515] * Update matterbridge.toml.sample Co-Authored-By: patcon <patrick.c.connolly@gmail.com>
* Add Gateway's name to RemoteNickFormat (#501)Duco van Amstel2018-10-071-0/+1
| | | | | In order to support extra use cases we should add the `{GATEWAY}` tag to the `RemoteNickFormat` string which would be replaced by the value of the `name=` field from a gateway's configuration. This is _very_ useful when you are forwarding, for example, multiple channels from one chat to a single channel on another one (one-way). It will help you identify the source channel of a message on the target chat.
* Reconnect on quit. (irc) See #431 (#445)Liam Stanley2018-06-091-12/+12
| | | | | * potential fixes for #431 * go: fix formatting/gofmt/goreturns
* Add config option MediaDownloadPath (#443)Remi Reuvekamp2018-06-081-28/+69
| | | | | | | | | | | | | | * Add config option MediaUploadPath MediaDownloadPath can be used instead of MediaServerUpload, for when your webserver is on the same system as matterbridge and matterbridge has write access to the serve dir. * Limit length of hash in MediaServer urls to 8chars Full SHA256 is unnecessary for uniqueness. Also; if a file has the same first 8 charachters of the SHA256 hash, it's still not a problem, as long as the filename is not the same.
* Add initial zulip supportWim2018-05-071-0/+2
|
* Use only alphanumeric for file uploads to mediaserver. Closes #416Wim2018-05-061-0/+6
|
* Fix crash on invalid filenamesWim2018-05-061-2/+6
|
* Fix regression on empty text with files attachedWim2018-03-061-1/+1
|
* Get the correct config values (gateway)Wim2018-03-061-3/+3
|
* Fix panic on empty config. Closes #386Wim2018-03-051-0/+1
|
* Fix tests and make megacheck happyWim2018-03-051-9/+0
|
* Use viper (github.com/spf13/viper) for configurationWim2018-03-041-25/+19
|
* Improve debug messagesWim2018-02-281-1/+2
|
* Do some small cleanupsWim2018-02-271-19/+25
|