Notify.php
authorAlan Knowles <alan@roojs.com>
Fri, 4 Jul 2014 03:12:55 +0000 (11:12 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 4 Jul 2014 03:12:55 +0000 (11:12 +0800)
Notify.php

index bad6700..4659e36 100644 (file)
@@ -42,7 +42,7 @@ class Pman_Core_Notify extends Pman
             
         ),
         'old' => array(
-            'desc' => 'Show old messages..',
+            'desc' => 'Show old messages.. (and new messages...)',
             'default' => 0,
             'short' => 'o',
             'min' => 0,
@@ -175,7 +175,12 @@ class Pman_Core_Notify extends Pman
         
         
         if (!empty($opts['old'])) {
+            // show old and new...
             
+            $w->orderBy('act_when DESC'); // latest first
+            $w->limit($opts['limit']); // we can run 
+            
+        } else {   
             // standard
             
             //$w->whereAdd('act_when > sent'); // eg.. sent is not valid..
@@ -190,11 +195,9 @@ class Pman_Core_Notify extends Pman
             
             $this->logecho("QUEUE is {$w->count()}");
             
-            $w->limit($opts['limit']); // we can run 1000 ...
-        } else {
-            $w->orderBy('act_when DESC'); // latest first
             $w->limit($opts['limit']); // we can run 1000 ...
         }
+        
         if (!empty($this->evtype)) {
             $w->evtype = $this->evtype;
         }