DataObjects/Core_notify.php
[Pman.Core] / DataObjects / Core_notify.php
index 0e80c6d..bdf3b76 100644 (file)
@@ -109,7 +109,7 @@ class Pman_Core_DataObjects_Core_notify extends DB_DataObject
     {
         switch($this->event_id) {
             case -1:
-                return 'DELIVERED';
+                return 'DELIVERED';   //not valid..
             case 0:
                 return 'PENDING';
             default:
@@ -146,13 +146,15 @@ class Pman_Core_DataObjects_Core_notify extends DB_DataObject
             switch ($q['query']['status']) {
                 
                 case 'SUCCESS';
-                    $this->is_active = 1;
+                    $this->whereAdd("msg_id  != ''");
                     break;
                 case 'FAILED';
-                    $this->is_active = 0;
+                    
+                    $this->whereAdd('msg_id  = '' AND event_id > 0  ');
+                    
                     break;
-                case 'PENDING';  
-                    $this->is_active = 0;
+                case 'PENDING';
+                    $this->whereAdd('event_id = 0 OR (event_id  > 0 AND act_when > NOW() )');
                     break;
                 case 'ALL':
                 default: