From f6861fb4b454bf83db54047d082a4a1e2101d239 Mon Sep 17 00:00:00 2001 From: Ailin Nemui Date: Tue, 26 Apr 2016 23:30:46 +0200 Subject: update nm2 - add support for realnames script --- scripts/nm2.pl | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'scripts') 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 -- cgit v1.2.3