blob: 32fd2e7cb5778a78bd2449c814a973e54e0d77b3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
use strict;
use warnings;
use Irssi;
use Irssi::TextUI;
use Irssi::Irc;
Irssi::expando_create('M_nopass', \&expando_nopass_modes, {});
sub expando_nopass_modes {
my ($server, $witem, $arg) = @_;
return '' unless ref($witem) eq 'Irssi::Irc::Channel';
my $modes_str = $witem->{mode};
my $key_str = $witem->{key};
if ($key_str) {
$modes_str =~ s/\Q$key_str\E//; # remove the key
$modes_str =~ s/\s*$//; # strip trailing space if we removed the key.
}
return $modes_str;
}
|