Commit Graph

128 Commits (master)

Author SHA1 Message Date
patrickxia 0bb521512a
Do not bridge CTCP commands other than ACTION (irc) (#2090)
CTCP commands other than ACTION are designed for client-to-client interaction on
IRC networks. Drop such messages when we receive them.

Also get rid of a "CTCP_ACTION" handler in the handler registration.

This

1) can't do anything (if anything, we wanted the string constant
   girc.CTCP_ACTION, which is "ACTION")
2) doesn't do anything in this context, because CTCP handlers are
   registered separately:
   f47717952b/ctcp.go (L205)

The PRIVMSG handler already listens to all CTCPs.

Thanks to @lexande for the bug report (found on a live instance).
3 weeks ago
Bryan Davis b2df32bc81
Clear existing IRC event handlers before connecting to new ones (irc) (#2138)
Clear IRC event handlers that we will be registering for the new
connection before registering new handlers. This prevents duplicate
event handlers in the case where we are connecting via a BNC and are
seeing a reconnect. Attempting to clear handlers when none have been set
is a no-op.

Fixes 42wim#1564
Co-authored-by: Andreas Vögele <andreas@andreasvoegele.com>
3 weeks ago
Kufat 6d5a3dff22
Allow substitution of bot's nick in RunCommands (irc) (#1890)
* Allow substitution of bot's nick in RunCommands

* Tweak description of "{BOTNICK}"

Made the description of "{BOTNICK}" consistent with that of other keywords
2 years ago
Wim e775a8a22e
Revert "Clear existing IRC event handlers before connecting new ones (#1795)"
This reverts commit f044b948e2.

Fixes #1815
2 years ago
Bryan Davis f044b948e2
Clear existing IRC event handlers before connecting new ones (#1795)
Clear all existing IRC event handler registrations before registering
new handlers in case we are connecting via a BNC and are seeing
a reconnect.

Fixes #1564
2 years ago
Wim f0f801402d
Refactor utf-8 conversion (irc) (#1767) 2 years ago
Wim c30e90ff3f
Fix panic in irc. Closes #1751 (#1760) 2 years ago
Wim c3644c8d3b
Add support for client certificate (irc) (#1710)
Supports https://libera.chat/guides/certfp.html
2 years ago
Santtu Lakkala df4d76e466
Allow binding to IP on IRC (#1640)
Add configuration option "Bind" that is passed on to girc, allowing
to choose which IP address to use on systems that have multiple ones.
3 years ago
Iris Morelle 61bab22dde
Add UserName and RealName options for IRC (#1590)
This allows setting custom values for the IRC username/ident and real
name (gecos) fields at server registration time with gIRC.

Co-authored-by: Wim <wim@42.be>
3 years ago
Wim c86137449e
Add a MessageClipped option to set your own clipped message. Closes #1359 (#1487) 3 years ago
James Lu a9f89dbc64
Add support for stateless bridging via draft/relaymsg (irc) (#1339)
* irc: add support for stateless bridging via draft/relaymsg

As discussed at https://github.com/42wim/matterbridge/issues/667#issuecomment-634214165

* irc: handle the draft/relaymsg tag in spoofed messages too

* Apply suggestions from code review

Co-authored-by: Wim <wim@42.be>

* Run gofmt on irc.go

* Document relaymsg in matterbridge.toml.sample

Co-authored-by: Wim <wim@42.be>
4 years ago
Wim 8eba2d3e50
Make handlers run async (irc) (#1325)
This makes the handlers run in a seperate go-routine in girc, and makes
sure that girc isn't blocked on executing PONG requests when
matterbridge takes a long time handling the incoming message.

This can happen when another bridge is in a backoff state where the
backoff time exceeds the IRC ping timeout.
4 years ago
Wim 0c19716f44
Join on invite (irc). Fixes #1231 (#1306) 4 years ago
Wim b24e1bafa1
Add support for irc to irc notice (irc). Fixes #754 (#1305) 4 years ago
Wim 4f8b19c686
Add PingDelay option (irc) (#1269) 4 years ago
Wim 61569a8610
Add even more debug for irc (#1266) 4 years ago
James Lu 37f7caf7f3
Skip gIRC built-in rate limiting (irc) (#1164)
By default, gIRC rate limits all outgoing messages. 
Since matterbridge already implements message throttling, this is extra layer of throttling is not necessary.
4 years ago
TheHolyRoger 5847f7758c
Only colour IRC nicks if there is one. (#1161) 4 years ago
Wim 393f9e998b
Update dependencies / vendor (#1146) 4 years ago
Wim ba0bfe70a8
Add StripMarkdown option (irc). (#1145)
Enable `StripMarkdown` to strip markdown for irc.
4 years ago
Wim f7ec9af9e8
Add extra space before colon in attachments (irc). Fixes #1089 (#1101) 4 years ago
Qais Patankar 8ae5917659
Be less lossy when throttling IRC messages (#1004)
Note that msg.Text and chucking it through a chan is OK: https://play.golang.org/p/MTfT3YSsgPX
4 years ago
Wim 2d277a15f5
Add scripting (tengo) support for every outgoing message (#806)
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.
5 years ago
chotaire 6b47e29583 Add verbose IRC joins/parts (ident@host) (#805)
New configuration setting: VerboseJoinPart (default is false)
5 years ago
Wim 380c38674c Fix deadlock on reconnect (irc). Closes #757 5 years ago
Wim 8a875f292e Revert fix for #722. Closes #781
Revert "Fix typo"

This reverts commit dffd67eb31.

Revert "Handle quit message relay better on gateways with one channel on the irc bridge #722"

This reverts commit 240559581a.

Revert "Support quits from irc correctly. Fixes #722 (#724)"

This reverts commit d76a04bd0a.
5 years ago
Wim 60a85621ea Return when not connected and drop a message (irc). Fixes #786 5 years ago
Wim cdf33e5748 Use default nick if none specified (irc). Fixes #785 5 years ago
Wim d76a04bd0a
Support quits from irc correctly. Fixes #722 (#724) 5 years ago
Wim 3123695869
Upgrade to latest girc version (irc) (#718) 5 years ago
Wim 94812d8648 Handle servers without MOTD (irc). Closes #692 5 years ago
Wim 8548b69e6e Fix possible data race (irc). Closes #693 5 years ago
Duco van Amstel 8a7efce941 Move golangci-lint configuration to file (#635) 6 years ago
Wim 27f5a1a685 Fix multiple channel join regression. Closes #639 6 years ago
Wim 57fbd3c723
Refactor irc handlers. Fix linting (#611) 6 years ago
Wim 9f66f93641
Add option to send RAW commands after connection (irc). Fixes #490 (#604) 6 years ago
Wim 0795906533 Rework connection logic (irc)
If IRC connection fails on first connect, bail out.
Wait until after nickserv auth until joining channels (also after reconnects)
Don't do a separate irc timeout, some connections take a while #503
6 years ago
Wim a2b45bc799 Fix Nickserv logic (irc) #602 6 years ago
Duco van Amstel ce21ba1545 Fix golint linter issues and enable it in CI (#593) 6 years ago
Duco van Amstel 85564a35fd Fix IRC line splitting. Closes #584 (#587) 6 years ago
Wim 399789811e Make gocritic linter happy 6 years ago
Wim 1794922263 Make unparam linter happy 6 years ago
David Hill 0e2522279e Clean up various stuff (#508)
* various cleanups
6 years ago
Wim d7c3570ba3 Check nickname on kick (irc). Closes #488 6 years ago
Wim 351b423e15 Add a bit more debugging (irc). #482 6 years ago
John 2d2d185200 Stop numbers being stripped after non-color control codes (irc) (#465)
Currently numbers are stripped not just after the color control code (\x03) but also after other formatting such as bold (\x02) and italic (\x1D), which is both unnecessary and leads to missing text from irc. This fixes that by only stripping numbers after the color control code.
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
Yuval Langer 6576409d60 Prevent white or black color codes (irc) (#434) 6 years ago
Kazuhiro NISHIYAMA f1db166ac4 Fix format string bug (irc) (#428) 6 years ago