Skip to content

Initial support for banning/kicking users on IRC

f_ requested to merge funderscore/irc into master

This merge request adds support for kicking users on IRC. With it, jonathan now has 2 alts:

  • a matrix user (e.g. @robot:postmarketos.org)
  • an IRC connection (e.g. pmosbot_irc) The matrix user is used like normal, while the IRC connection is used to kickban users on IRC.

Along with IRC support, some QOL features include:

  • Can +o itself before kicking/banning (if the IRC network has ChanServ)
  • Can reconnect automatically
  • Always uses an encrypted connection (because who connects to IRC unencrypted in 2024?)
  • Supports NickServ login (required for autoop)
  • Can set IRC gecos/realname to e.g. jonathan, the pmOS bot
  • Autojoins managed IRC channels

This MR is incompatible with existing database files. You need to either start from scratch or modify the file.

Here it is in action:

In managed channel:

---> You (f_[xmpp]) joined the room
<f_[xmpp]> :D   
Mode ##matrix-irc-bans-sync-test [+b f_[xmpp]*!*@*] by pmosbot_irc
-!- You have been kicked by pmosbot_irc Reason: Spam

Note: "Mode +b", when set on a user, prevents that user from joining the channel. See: https://libera.chat/guides/channelmodes

In admin room:

<f_[mtrx]> !ban @_oftc_f_[xmpp]:matrix.org Spam
 *  pmosbot_matrix: Banning '@_oftc_f_[xmpp]:matrix.org' for 'Spam'

Cc: @z3ntu @craftyguy

Edited by f_

Merge request reports