aboutsummaryrefslogtreecommitdiffstats
path: root/prompt_info/uberprompt.pl
diff options
context:
space:
mode:
Diffstat (limited to 'prompt_info/uberprompt.pl')
-rw-r--r--prompt_info/uberprompt.pl26
1 files changed, 25 insertions, 1 deletions
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);