diff options
author | friendica <info@friendica.com> | 2012-11-19 16:51:15 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-11-19 16:51:15 -0800 |
commit | 194ef02c287edbce6b797f1411afe0bb964e8c80 (patch) | |
tree | cfb80e3bc0cb356952e2ac8d1320d1cb72ff5fd3 /include/deliver.php | |
parent | db77309bc399669c5c98f4fac99f2d5f96cfbaeb (diff) | |
download | volse-hubzilla-194ef02c287edbce6b797f1411afe0bb964e8c80.tar.gz volse-hubzilla-194ef02c287edbce6b797f1411afe0bb964e8c80.tar.bz2 volse-hubzilla-194ef02c287edbce6b797f1411afe0bb964e8c80.zip |
DATABASE: outq additions, delivery now getting the notify across to the other side
Diffstat (limited to 'include/deliver.php')
-rw-r--r-- | include/deliver.php | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/include/deliver.php b/include/deliver.php new file mode 100644 index 000000000..df1596c10 --- /dev/null +++ b/include/deliver.php @@ -0,0 +1,40 @@ +<?php + +require_once('include/cli_startup.php'); +require_once('include/zot.php'); + + +function deliver_run($argv, $argc) { + + cli_startup(); + + $a = get_app(); + + if($argc < 2) + return; + + logger('deliver: invoked: ' . print_r($argv,true), LOGGER_DEBUG); + + for($x = 1; $x < $argc; $x ++) { + $r = q("select * from outq where outq_hash = '%s' limit 1", + 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()), + dbesc($argv[$x]) + ); + } + } + } +} + +if (array_search(__file__,get_included_files())===0){ + deliver_run($argv,$argc); + killme(); +} |