Created
September 9, 2010 16:52
-
-
Save lysol/572163 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Redact the seditious statements of your chosen list of nicks with easily | |
# cracked encryption. | |
# | |
# /set redact_nicks nick1 ... nickn | |
# | |
# Their stuff still gets logged, | |
# but you don't have to see them unless you want to, | |
# in which case you can select the text with yr mouse. | |
use strict; | |
use Irssi; | |
use vars qw($VERSION %IRSSI); | |
$VERSION = "0.1"; | |
%IRSSI = ( | |
authors => "rupa", | |
name => "redact", | |
description => "redact the words of those tiresome or officious.", | |
license => "BSD", | |
); | |
sub redact_it { | |
my ($server, $data, $nick, $mask, $target) = @_; | |
my $result = 0; | |
foreach (split(' ', Irssi::settings_get_str('redact_words'))) | |
{ | |
$result = 1 if ($data =~ /$_/); | |
} | |
if( grep(/^$nick$/, split(' ', Irssi::settings_get_str('redact_nicks'))) | |
|| $result == 1) | |
{ | |
# black on black | |
$data = "\0031,1" . $data; | |
} | |
Irssi::signal_continue($server, $data, $nick, $mask, $target); | |
} | |
Irssi::signal_add('message public', 'redact_it'); | |
Irssi::signal_add('message irc action', 'redact_it'); | |
Irssi::settings_add_str('ministryoftruth', 'redact_nicks', 'redubious'); | |
Irssi::settings_add_str('ministryoftruth', 'redact_words', 'WoW'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment