diff options
| author | martin f. krafft | 2017-02-04 02:11:54 +0100 |
|---|---|---|
| committer | martin f. krafft | 2017-02-04 02:14:23 +0100 |
| commit | eae3efb813b4864c532c5728880cac45a3263333 (patch) | |
| tree | 8bce3569e6c7ae9b74a4176d04c53a774364df35 /scripts | |
| parent | d570824cd72ed5d4a2a8a2c19af847d72308427e (diff) | |
| download | scripts.irssi.org-eae3efb813b4864c532c5728880cac45a3263333.tar.bz2 | |
Add discard subcommand to drop messages
Signed-off-by: martin f. krafft <madduck@madduck.net>
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/postpone.pl | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/postpone.pl b/scripts/postpone.pl index 72e0a90..11011f2 100644 --- a/scripts/postpone.pl +++ b/scripts/postpone.pl @@ -5,7 +5,7 @@ use strict; use vars qw($VERSION %IRSSI); -$VERSION = "20030208"; +$VERSION = "20170204"; %IRSSI = ( authors => "Stefan 'tommie' Tomanek", contact => "stefan\@pico.ruhr.de", @@ -37,6 +37,8 @@ sub show_help() { Display this help /postpone flush <nick> Flush postponed messages to <nick> +/postpone discard <nick> + Discard postponed messages to <nick> /postpone list List postponed messages "; @@ -85,11 +87,11 @@ sub cmd_postpone ($$$) { my @arg = split(/ /, $args); if (scalar(@arg) < 1) { #foo - } elsif ($arg[0] eq 'flush' && defined $arg[1]) { + } elsif (($arg[0] eq 'discard' || $arg[0] eq 'flush') && defined $arg[1]) { return unless ($witem && $witem->{type} eq "CHANNEL"); while (scalar(@{$messages{$server->{tag}}{$witem->{name}}{$arg[1]}}) > 0) { my $msg = pop @{$messages{$server->{tag}}{$witem->{name}}{$arg[1]}}; - $server->command('MSG '.$witem->{name}.' '.$msg); + $server->command('MSG '.$witem->{name}.' '.$msg) if $arg[0] eq 'flush'; } } elsif ($arg[0] eq 'list') { my $text; |
