json_encode(array('success' => true, 'pickup' => array(array('notify' => $notify,'message' => $mm))))); zot_import($msg,z_root()); } } else { $msg = array('body' => json_encode(array('success' => true, 'pickup' => array(array('notify' => $notify,'message' => $m))))); $dresult = zot_import($msg,z_root()); } remove_queue_item($r[0]['outq_hash']); if($dresult && is_array($dresult)) { // delivery reports for local deliveries do not require encryption foreach($dresult as $xx) { if(is_array($xx) && array_key_exists('message_id',$xx)) { if(DReport::is_storable($xx)) { q("insert into dreport ( dreport_mid, dreport_site, dreport_recip, dreport_name, dreport_result, dreport_time, dreport_xchan ) values ( '%s', '%s', '%s', '%s', '%s', '%s', '%s' ) ", dbesc($xx['message_id']), dbesc($xx['location']), dbesc($xx['recipient']), dbesc(($xx['name']) ? $xx['name'] : EMPTY_STR), dbesc($xx['status']), dbesc(datetime_convert($xx['date'])), dbesc($xx['sender']) ); } } } } q("delete from dreport where dreport_queue = '%s'", dbesc($argv[$x]) ); continue; } } // otherwise it's a remote delivery - call queue_deliver() with the $immediate flag queue_deliver($r[0],true); } } } }