diff options
| author | Ailin Nemui | 2016-04-26 23:30:46 +0200 |
|---|---|---|
| committer | Ailin Nemui | 2016-04-26 23:30:46 +0200 |
| commit | f6861fb4b454bf83db54047d082a4a1e2101d239 (patch) | |
| tree | 0b1fc573122c07476b9765e933f2d03d58172bee /scripts/nm2.pl | |
| parent | 91c8e2ec878d6942b11f61daa5cfef1d211de0d9 (diff) | |
| download | scripts.irssi.org-f6861fb4b454bf83db54047d082a4a1e2101d239.tar.bz2 | |
update nm2
- add support for realnames script
Diffstat (limited to 'scripts/nm2.pl')
| -rw-r--r-- | scripts/nm2.pl | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/scripts/nm2.pl b/scripts/nm2.pl index 08ec53d..b553bf2 100644 --- a/scripts/nm2.pl +++ b/scripts/nm2.pl @@ -4,7 +4,7 @@ use v5.14; use List::Util qw(min max); use Hash::Util qw(lock_keys); -our $VERSION = '2.0-dev'; # cb10e88bcd58d0c +our $VERSION = '2.1'; # a42b713aaa38823 our %IRSSI = ( authors => 'Nei', contact => 'Nei @ anti@conference.jabber.teamidiot.de', @@ -116,6 +116,13 @@ my $format_re = qr/ %(?=[}%{]) sub update_expando { my ($mode, $server, $target, $nick, $space) = @_; my $t_add; + if (exists $Irssi::Script::{'realnames::'} + && (my $code = 'Irssi::Script::realnames'->can('_get_nick_chan'))) { + if (my $i = $code->($server, $target, $nick)) { + $nick = $i->{n}{realname} + if length $i->{n}{realname}; + } + } my $nl = length $nick; my $pad_len = max(0, $space - $nl); if ($S{truncate_nick}) { @@ -554,7 +561,9 @@ init(); # Changelog # ========= -# 2.0-dev +# 2.1 - support realnames script +# +# 2.0 # - fix crash if xmpp action signal is not registered (just ignore it) # - do not grow either when using no-shrink with maxlength # - hopefully fix alignment in xmpp muc |
