diff options
author | friendica <info@friendica.com> | 2012-12-02 20:54:20 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-12-02 20:54:20 -0800 |
commit | 7b4a92146fd905c4fdecd800f07e81dabeeb6962 (patch) | |
tree | 368c2d45e75ead32f4986a9cf93e6e3c33dd5b93 /include/deliver.php | |
parent | c38ec1ab4835d436eb3d77f3fd99f3147a123326 (diff) | |
download | volse-hubzilla-7b4a92146fd905c4fdecd800f07e81dabeeb6962.tar.gz volse-hubzilla-7b4a92146fd905c4fdecd800f07e81dabeeb6962.tar.bz2 volse-hubzilla-7b4a92146fd905c4fdecd800f07e81dabeeb6962.zip |
local delivery
Diffstat (limited to 'include/deliver.php')
-rw-r--r-- | include/deliver.php | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/include/deliver.php b/include/deliver.php index df1596c10..546b75785 100644 --- a/include/deliver.php +++ b/include/deliver.php @@ -20,16 +20,27 @@ function deliver_run($argv, $argc) { dbesc($argv[$x]) ); if($r) { - $result = zot_zot($r[0]['outq_posturl'],$r[0]['outq_notify']); - if($result['success']) { - zot_process_response($result, $r[0]); - } - else { - $y = q("update outq set outq_updated = '%s' where outq_hash = '%s' limit 1", - dbesc(datetime_convert()), + if($r[0]['outq_posturl'] === z_root() . '/post') { + // local delivery + // we should probably batch these and save a few delivery processes + $msg = array('body' => json_encode(array('pickup' => array(array('notify' => json_decode($r[0]['outq_notify'],true),'message' => json_decode($r[0]['outq_msg'],true)))))); + zot_import($msg); + $r = q("delete from outq where outq_hash = '%s' limit 1", dbesc($argv[$x]) ); } + else { + $result = zot_zot($r[0]['outq_posturl'],$r[0]['outq_notify']); + if($result['success']) { + zot_process_response($result, $r[0]); + } + else { + $y = q("update outq set outq_updated = '%s' where outq_hash = '%s' limit 1", + dbesc(datetime_convert()), + dbesc($argv[$x]) + ); + } + } } } } |