From 139f8efe3395b2b74de587a88ddc26fbd1a50155 Mon Sep 17 00:00:00 2001 From: Tom Feist Date: Wed, 24 Nov 2010 19:35:51 +0000 Subject: uberprompt: prompt now updates correctly with $cumode expando --- prompt_info/uberprompt.pl | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/prompt_info/uberprompt.pl b/prompt_info/uberprompt.pl index 191d46f..509566a 100644 --- a/prompt_info/uberprompt.pl +++ b/prompt_info/uberprompt.pl @@ -216,6 +216,7 @@ sub init { Irssi::signal_add('window server changed', \&uberprompt_refresh); Irssi::signal_add('server nick changed', \&uberprompt_refresh); + Irssi::signal_add('nick mode changed', \&refresh_if_me); # install our statusbars if required. if (Irssi::settings_get_bool('uberprompt_autostart')) { @@ -240,6 +241,29 @@ sub init { } } +sub refresh_if_me { + my ($channel, $nick) = @_; + + return unless $channel and $nick; + + my $server = Irssi::active_server; + my $window = Irssi::active_win; + + return unless $server and $window; + + my $my_chan = $window->{active}->{name}; + my $my_nick = $server->parse_special('$N'); + + + print "Chan: $channel->{name}, " + . "nick: $nick->{nick}, " + . "me: $my_nick, chan: $my_chan" if DEBUG; + + if ($my_chan eq $channel->{name} and $my_nick eq $nick->{nick}) { + uberprompt_refresh(); + } +} + sub length_request_handler { $emit_request = 1; uberprompt_render_prompt(); @@ -423,7 +447,7 @@ sub _sbar_command { $args_str .= ' ' if length $args_str && defined $item; my $command = sprintf 'STATUSBAR %s %s %s%s', - $bar, $cmd, $args_str, defined($item)?$item:''; + $bar, $cmd, $args_str, defined $item ? $item : ''; print "Running command: $command" if DEBUG; Irssi::command($command); -- cgit v1.2.3