From: IsaacG Date: Tue, 19 Oct 2010 16:43:29 +0000 (-0400) Subject: Added an /ack_spoke command to make as though you spoke in the current window without... X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=f0a077d2c103d4b885199919ddc20b6f231c7718;p=irssi-scripts.irssi.org.git Added an /ack_spoke command to make as though you spoke in the current window without having to actually speak, ie temporarily push up the window's sort priority --- diff --git a/scripts/ack.pl b/scripts/ack.pl index d7687f5..5187394 100644 --- a/scripts/ack.pl +++ b/scripts/ack.pl @@ -99,7 +99,13 @@ sub cmd_own_public my ($server, $msg, $target) = @_; my $window = $server->window_find_item($target); my $refnum = $window->{'refnum'}; - # First remove the refnum from the list if it exists + $last_spoke{$refnum} = time; +} + +sub cmd_ack_spoke +{ + my ($data, $server, $witem) = @_; + my $refnum = $witem->window()->{'refnum'}; $last_spoke{$refnum} = time; } @@ -111,6 +117,9 @@ Irssi::command_bind("ack", "cmd_ack"); Irssi::command_bind("ack_del", "cmd_ack_del"); Irssi::command_bind("ack_add", "cmd_ack_add"); +# Command to add a window to the last_spoke hash for temporary priority increase +Irssi::command_bind("ack_spoke", "cmd_ack_spoke"); + # Hook to track when you last_spoke in a channel Irssi::signal_add("message own_public", "cmd_own_public"); Irssi::signal_add("message irc own_action", "cmd_own_public");