Commit Graph

15 Commits (89b0d362d29179b389b203e046b22b5b6e5f8310)

Author SHA1 Message Date
Wim 89b0d362d2
Remove gitter bridge (#2035)
See https://blog.gitter.im/2023/02/13/gitter-has-fully-migrated-to-matrix/
1 year ago
Wim 1e0b4532bd
Show deprecate warnings about old tengo settings (#1271) 4 years ago
Wim 28783a4146
Do configuration validation on start-up. Fixes #888 (#889)
Fail if:
* we don't have any gateways configured
* we have gateways configured but with non-existing bridge configuration
* we have gateways configured without any configuration
5 years ago
Wim bf21604d42
Make all loggers derive from non-default instance (#728) 5 years ago
Wim 1bb39eba87
Add scripting (tengo) support for every incoming message (#731)
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
5 years ago
Wim 4525fa31aa
Allow regexs in ignoreNicks. Closes #690 (#720) 5 years ago
Duco van Amstel da8e415ae1 Use logrus imports instead of log (#662) 6 years ago
Wim ccd55d2a28
Refactor gateway (#648)
* 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
6 years ago
Patrick Connolly f2088a687e Extract bridgeMap into own package to improve testability (#601) 6 years ago
Wim b2a07aba3a Make goconst linter happy 6 years ago
Duco van Amstel 3dd4ec57ff Fix race in gateway test. (#520) 6 years ago
Liam Stanley 51327a4056 Reconnect on quit. (irc) See #431 (#445)
* potential fixes for #431
* go: fix formatting/gofmt/goreturns
6 years ago
Wim 98027446c8 Fix tests and make megacheck happy 6 years ago
Wim 5b191f78a0 Update tests with gofmt 7 years ago
Wim 83ef61287e Refactor. Add tests 7 years ago