rev 1350 - trunk/siesta/bin

[prev] [thread] [next] [lurker] [Date index for 2003/08/14]

From: richardc
Subject: rev 1350 - trunk/siesta/bin
Date: 08:48 on 14 Aug 2003
Author: richardc
Date: 2003-08-14 08:48:09 +0100 (Thu, 14 Aug 2003)
New Revision: 1350

Modified:
   trunk/siesta/bin/nacho
Log:
'cosmetic' touches


Modified: trunk/siesta/bin/nacho
===================================================================
--- trunk/siesta/bin/nacho	2003-08-14 07:33:56 UTC (rev 1349)
+++ trunk/siesta/bin/nacho	2003-08-14 07:48:09 UTC (rev 1350)
@@ -625,7 +625,6 @@
 $commands{'show-deferred'} = sub {
     my $mess_id = shift;
 
-
     # show an individual deferred message
     if (defined $mess_id) {
         my $deferred = Siesta::Deferred->retrieve($mess_id)
@@ -634,10 +633,23 @@
         return;
     }
 
+    my @all = Siesta::Deferred->retrieve_all;
+    unless (@all) {
+        print "No deferred messages\n";
+        return;
+    }
 
-    # otherwise
-    foreach my $deferred ( Siesta::Deferred->retrieve_all ) {
-        print $deferred->id(),") ",$deferred->message->subject(), " (by ", $deferred->who->email(), " because '",$deferred->why,"')\n";
+    foreach my $deferred (@all) {
+        print +(
+            "Deferred-Id: ", $deferred->id,
+            "\nReason: ", $deferred->why,
+            "\nOwner: ", $deferred->who->email,
+            "\n\n From: ",    $deferred->message->header('From'),
+            "\n To: ",      $deferred->message->header('To'),
+            "\n Subject: ", $deferred->message->subject,
+            "\n Date: ",    $deferred->message->header('Date'),
+            "\n\n",
+           );
     }
 };
 
@@ -659,6 +671,17 @@
     print "Sucessfully resumed message $mess_id\n";
 };
 
+$commands{'delete-deferred'} = sub {
+    my $mess_id = shift;
+
+    my $message = Siesta::Deferred->retrieve($mess_id)
+      or die "No such deferred message\n";
+
+    $message->delete;
+    print "Message deleted from deferral queue\n";
+};
+
+
 #####
 #
 # Misc stuff

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