{
switch($this->event_id) {
case -1:
- return 'DELIVERED';
+ return 'DELIVERED'; //not valid..
case 0:
return 'PENDING';
default:
switch ($q['query']['status']) {
case 'SUCCESS';
- $this->whereAdd("msgid != ''");
+ $this->whereAdd("msg_id != ''");
break;
case 'FAILED';
- $this->whereAdd('event_id > 0 AND act_when <= NOW() ');
- $this->is_active = 0;
+
+ $this->whereAdd('msg_id = '' AND event_id > 0 ');
+
break;
case 'PENDING';
-
- $this->is_active = 0;
+ $this->whereAdd('event_id = 0 OR (event_id > 0 AND act_when > NOW() )');
break;
case 'ALL':
default: