diff options
| author | ailin-nemui | 2017-04-25 01:36:37 +0200 |
|---|---|---|
| committer | GitHub | 2017-04-25 01:36:37 +0200 |
| commit | 9960e77e808baab33b3c1acdf7a6cbb6458e3949 (patch) | |
| tree | 0452cc9da483c6d89117a780f44062b28a8346a0 | |
| parent | ae541807ac8485ddb9c09ed6785fcc7822f78eff (diff) | |
| parent | d5738727ed90499a80ae371125e05232f22984b0 (diff) | |
| download | scripts.irssi.org-9960e77e808baab33b3c1acdf7a6cbb6458e3949.tar.bz2 | |
Merge pull request #402 from vague666/notes_pl_update
Bugs in delete note code
| -rw-r--r-- | scripts/notes.pl | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/notes.pl b/scripts/notes.pl index ea60379..0d7a47e 100644 --- a/scripts/notes.pl +++ b/scripts/notes.pl @@ -145,7 +145,7 @@ sub cmd_notes_del { my $patt = join('|', @chatnets); my @networks = grep {/$patt/i} keys %$args; - my $purge = $args->{purge}; + my $purge = (defined $args->{purge} ? 1 : 0); unless ($purge || ($type && $pattern)) { _error "Could not parse command\n" . usage(), $witem; return; @@ -157,7 +157,7 @@ sub cmd_notes_del { return; } else { - push @networks, fc $server->{tag}; + push @networks, fc $server->{tag} if !@networks; } for (@networks) { @@ -253,9 +253,9 @@ Irssi::command_bind('notes' => sub { Irssi::command_runsub ('notes', $data, $server, $item ) ; }); -Irssi::command_bind('notes add', \&cmd_notes_add); -Irssi::command_bind('notes del', \&cmd_notes_del); -Irssi::command_bind('notes list', \&cmd_notes_list); +Irssi::command_bind('notes add', 'cmd_notes_add'); +Irssi::command_bind('notes del', 'cmd_notes_del'); +Irssi::command_bind('notes list', 'cmd_notes_list'); Irssi::command_bind('notes help', sub { Irssi::active_win()->print(usage()); }); Irssi::command_set_options('notes add', join(' ', @chatnets) . ' +nick +mask'); |
