aboutsummaryrefslogtreecommitdiffstats
path: root/dimpid.pl
blob: 56af8bfce8afd105f91d3c4bad15213e58b042b4 (plain)
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
use strict;

use Irssi;

our $VERSION = '1.00';
our %IRSSI = {
	authors     => 'Teddy Wing',
	contact     => 'irssi@teddywing.com',
	name        => 'Dimpid',
	description => 'Dim messages from certain nicks',
	license     => 'GPL',
};


use constant ESCAPE => "\x{03}";
use constant GREY => '14';

Irssi::signal_add('message public', sub {
	my ($server, $text, $nick, @rest) = @_;

	my @nicks = split(' ', Irssi::settings_get_str('dimpid_nicks'));

	if (grep($_ eq $nick, @nicks)) {
		Irssi::signal_continue(
			$server,
			ESCAPE . GREY . $text . ESCAPE,
			$nick,
			@rest,
		);
	}
});


Irssi::settings_add_str('dimpid', 'dimpid_nicks', '');