From 12541f277d5bbb121a3c6f59a54053a236832ab7 Mon Sep 17 00:00:00 2001 From: dakkar Date: Tue, 27 Dec 2016 16:26:52 +0000 Subject: fix MailStore::FS test & impl --- lib/Sietima/MailStore/FS.pm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/Sietima/MailStore/FS.pm b/lib/Sietima/MailStore/FS.pm index 1641c55..a45b433 100644 --- a/lib/Sietima/MailStore/FS.pm +++ b/lib/Sietima/MailStore/FS.pm @@ -62,8 +62,13 @@ sub retrieve_by_tags($self,@tags) { state $check = compile(Object,slurpy ArrayRef[Str]);$check->(@_); my %msgs; - for my $tag (@tags) { - $_++ for @msgs{$self->_tagged_by($tag)}; + if (@tags) { + for my $tag (@tags) { + $_++ for @msgs{$self->_tagged_by($tag)}; + } + } + else { + $msgs{$_->basename}=0 for $self->_msgdir->children; } my @ret; @@ -82,7 +87,7 @@ sub remove($self,$id) { state $check = compile(Object,Str);$check->(@_); for my $tag_file ($self->_tagdir->children) { - $tag_file->edit_lines( sub { /\A\Q$id\E\n?\z/ ? '' : $_ } ); + $tag_file->edit_lines( sub { $_='' if /\A\Q$id\E\n?\z/ } ); } $self->_msgdir->child($id)->remove; -- cgit v1.2.3