From ArchWiki
< Irssi
Revision as of 20:15, 6 September 2011 by Strcat (talk | contribs) (<tt>text</tt> -> {{Codeline|text}} for trivial cases)
Jump to: navigation, search


The irssi-otr module brings Off-the-Record Messaging to your favorite IRC client.


You can install the Irssi OTR module from the AUR. If you like to test bleeding edge software, there is also a Git version.


See the README.

Loading the module on startup

If you are tired of typing Template:Codeline you can put the following in your Template:Codeline:

LOAD otr

Stripping HTML

If you are using irssi-otr with BitlBee you will notice that some clients send you HTML formatted messages. Normally BitlBee automatically strips the HTML formatting, but since the messages are encrypted this doesn't work anymore. Nevertheless you can achieve the same by stripping the HTML with regular expressions using the Trigger script. Just make sure you load the script before the otr module. You can either do this manually or again make your Template:Codeline look like this:

LOAD otr

Also make sure that Template:Codeline is not in Template:Codeline since the files from this directory are loaded after Template:Codeline.

Since it is not possible to perfectly match HTML code with regular expressions we will take a somewhat conservative approach. We will only strip HTML tags we explicitly specified from PRIVMSGS from the BitlBee network, where we assume you added you server.

You can Template:Codeline the following lines or copy them to Template:Codeline.

-privmsgs -nocase -tags 'BitlBee' -regexp '</?(a|b|body|div|em|font|i|s|u)( +\w+=".*?")*>' -replace '' 

You can even make HTML line breaks look like multiple messages:

-privmsgs -nocase -tags 'BitlBee' -regexp '(\s*<br>\s*)+' -replace '\n�8/<�g�</$N�8/>�g �e' 

Where Template:Codeline is the non-printable character Template:Codeline. In vi(m) you can get it by pressing Template:Codeline in insert mode. If your are using a theme different than the default one you probably have to adapt the replacing string to match color and indentation.

And finally we convert some escaped HTML characters:

-privmsgs -nocase -tags 'BitlBee' -regexp '&amp;' -replace '&' 
-privmsgs -nocase -tags 'BitlBee' -regexp '&gt;' -replace '>' 
-privmsgs -nocase -tags 'BitlBee' -regexp '&lt;' -replace '<' 
-privmsgs -nocase -tags 'BitlBee' -regexp '&quot;' -replace '"' 

These are just some basic replaces, just extend them if you need more.