From 1d9a8884db63d430c96ce53e3d24c278dd8dbd8c Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Mon, 19 Sep 2022 21:15:04 +0200 Subject: Have rcirc handle bridge bots * doc/misc/rcirc.texi (Dealing with Bridge Bots): Document new feature. * etc/NEWS: Mention the new feature. * lisp/net/rcirc.el (rcirc-markup-text-functions): Add new markup function (rcirc-pseudo-nicks): Add new local variable. (rcirc-channel-nicks): Use 'rcirc-pseudo-nicks' for nick completion. (rcirc-bridge-bot-alist): Add new user option. (rcirc-bridged-nick): Add new face. (rcirc-markup-bridge-bots): Add new function. --- doc/misc/rcirc.texi | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'doc/misc/rcirc.texi') diff --git a/doc/misc/rcirc.texi b/doc/misc/rcirc.texi index 8c798d6c33b..a028697847c 100644 --- a/doc/misc/rcirc.texi +++ b/doc/misc/rcirc.texi @@ -859,6 +859,7 @@ Here are some examples of stuff you can do to configure @code{rcirc}. * Changing the time stamp format:: * Defining a new command:: * Using rcirc with bouncers:: +* Dealing with Bridge Bots:: @end menu @node Skipping /away messages using handlers @@ -992,6 +993,46 @@ displayed. A simple configuration to fix the above example might be: rcirc-channel-filter #'local/rcirc-soju-suffix) @end smallexample +@node Dealing with Bridge Bots +@section Dealing with Bridge Bots +@cindex bridge + +It is increasingly common for IRC channels to be ``bridged'' onto +other networks such as XMPP, Matrix, etc. Sometimes the software does +a good job at mapping each non-IRC user into an IRC user, but more +often than not it doesn't. In that case you might receive a message +like: + +@example +@verbatim +09:47 I am not on IRC +@end verbatim +@end example + +where @samp{bridge} is a bot responsible for sending messages back and +forth between networks, and @samp{john} is the user name of someone on +a different network. Note that the bot indicates this within the +message (@verb{| I am not on IRC|}) that appears in your chat +buffer. + +@vindex rcirc-bridge-bot-alist +If this annoys you, the user option @code{rcirc-bridge-bot-alist} may +be of use. It consists of descriptions of what users are these kinds +of ``bridge bots'' and how they format their messages. To handle the +above example, we might set the user option to: + +@example +(setopt rcirc-bridge-bot-alist + '(("bridge" . "<\\(.+?\\)>[[:space:]]+"))) +@end example + +If there is an entry for the current user, @code{rcirc} will take the +associated regular expression and try to find a match in the message +string. If it manages to find anything, the matching expression is +deleted from the message. The regular expression must contain at +least one group that will match the user name of the bridged message. +This will then be used to replace the username of the bridge bot. + @node GNU Free Documentation License @appendix GNU Free Documentation License @include doclicense.texi -- cgit v1.2.3