[siesta-commit] siesta/lib/Siesta List.pm,1.40,1.41 Message.pm,1.36,1.37

[prev] [thread] [next] [lurker] [Date index for 2003/03/16]

From: clampr
Subject: [siesta-commit] siesta/lib/Siesta List.pm,1.40,1.41 Message.pm,1.36,1.37
Date: 11:58 on 16 Mar 2003
Update of /cvsroot/siesta/siesta/lib/Siesta
In directory sc8-pr-cvs1:/tmp/cvs-serv31941/lib/Siesta

Modified Files:
	List.pm Message.pm 
Log Message:
refactor $list->defer_queue

Index: List.pm
===================================================================
RCS file: /cvsroot/siesta/siesta/lib/Siesta/List.pm,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- List.pm	16 Mar 2003 00:47:53 -0000	1.40
+++ List.pm	16 Mar 2003 11:58:01 -0000	1.41
@@ -222,13 +222,24 @@
 sub deferred {
     my $self = shift;
 
-    my $name = $self->name;
+    my $path = $self->defer_queue;
 
     return map {
         local *FILE;
         open FILE, $_ or die "couldn't open '$_': $!";
         new Siesta::Message \*FILE;
-    } map { <$Siesta::Config::ROOT/queue/$name/$_/*> } qw( new cur );
+    } map { <$path$_/*> } qw( new cur );
+}
+
+=head2 ->defer_queue
+
+returns where to defer messages to
+
+=cut
+
+sub defer_queue {
+    my $self = shift;
+    "$Siesta::Config::ROOT/queue/".$self->name."/";
 }
 
 1;

Index: Message.pm
===================================================================
RCS file: /cvsroot/siesta/siesta/lib/Siesta/Message.pm,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- Message.pm	16 Mar 2003 02:23:46 -0000	1.36
+++ Message.pm	16 Mar 2003 11:58:01 -0000	1.37
@@ -112,23 +112,16 @@
     my $self = shift;
     my %args = @_;
 
-    my $list = $self->list->name;
-
     my $for = delete $args{for} || die "need to know why we're deferring";
     $self->deferred_for( $for );
 
-
-    my $queue = "$Siesta::Config::ROOT/queue";
-    eval { mkpath( $queue, 0, 0777 ) };
-    die "Couldn't mkpath '$queue'" if $@;
-
     # hacky, hopefully this'll go in: http://rt.cpan.org/NoAuth/Bug.html?id=2236
     my $clone = $self->clone;
     bless $clone, 'Mail::Internet';
     my $ld = new Mail::LocalDelivery $clone;
 
     # deliver to a maildir
-    $ld->deliver( "$queue/$list/" ) or die "LD failed!";
+    $ld->deliver( $self->list->defer_queue ) or die "LD failed!";
 }
 
 sub confirmed {



Generated at 13:57 on 01 Jul 2004 by mariachi 0.52