-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathirssi-ignore_join_blob.pl
38 lines (32 loc) · 1.12 KB
/
irssi-ignore_join_blob.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# vim:ft=perl:et:
# abstract: ignore the blob of text displayed when (re)joining a channel
use strict;
use Irssi;
our $VERSION = '0.02';
our %IRSSI = (
authors => q{Magnus Woldrich},
contact => q{[email protected]},
name => q{ignore_join_blob},
description => q{Ignore the blob of text displayed when (re)joining a channel},
license => q{MIT},
);
## ignores this:
# > Topic for #ubuntu: hi
# > Topic set by DalekSec
# > Home page for #ubuntu: https://www.ubuntu.com
# > Channel #ubuntu created Sun Nov 26 07:42:41 2006
#
# These lines have the CRAP MSGLEVEL (because they are crap) but they don't
# respond to an /ignore * CRAP:
# https://github.com/irssi/irssi/issues/992
# https://github.com/trapd00r/irssi/commit/87f38a20beda81e409a72efd323f5db45d824927
my $bad = qr(Topic (?:for|set)|Channel [#]\S+ created|Home page for[#]\S+);
sub sig_print_text {
my ($dest, $string, $stripped) = @_;
if($dest->{level} & MSGLEVEL_CRAP) {
if($stripped =~ m/Topic (for|set)|Channel [#]\S+ created|Home page for [#]\S+/) {
Irssi::signal_stop();
}
}
}
Irssi::signal_add_first('print text', \&sig_print_text);