aboutsummaryrefslogtreecommitdiffstats
path: root/prompt_info
diff options
context:
space:
mode:
authorTom Feist <shabble@metavore.org>2010-11-24 19:35:51 +0000
committerTom Feist <shabble@metavore.org>2010-11-24 19:35:51 +0000
commit139f8efe3395b2b74de587a88ddc26fbd1a50155 (patch)
tree56fe2222a7239f0d55a394640b910f2674ca6eb7 /prompt_info
parentuberprompt: updates prompt for changes to $N (your nick) (diff)
downloadirssi-scripts-139f8efe3395b2b74de587a88ddc26fbd1a50155.tar.gz
irssi-scripts-139f8efe3395b2b74de587a88ddc26fbd1a50155.zip
uberprompt: prompt now updates correctly with $cumode expando
Diffstat (limited to '')
-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);