aboutsummaryrefslogtreecommitdiffstats
path: root/include/deliver.php
diff options
context:
space:
mode:
authormrjive <mrjive@mrjive.it>2015-09-22 13:11:54 +0200
committermrjive <mrjive@mrjive.it>2015-09-22 13:11:54 +0200
commit5ec3d3e36d8bb7918b844b4ebbeb878c4b45e30d (patch)
treeece0274497ae0f3bc427cfa6e8f10752dd9934dc /include/deliver.php
parent49d11ed9f88531bcd03f2f129230b0352014c22c (diff)
parent4b13f0e025b08263d7231845bc76034d9adc7847 (diff)
downloadvolse-hubzilla-5ec3d3e36d8bb7918b844b4ebbeb878c4b45e30d.tar.gz
volse-hubzilla-5ec3d3e36d8bb7918b844b4ebbeb878c4b45e30d.tar.bz2
volse-hubzilla-5ec3d3e36d8bb7918b844b4ebbeb878c4b45e30d.zip
Merge pull request #3 from redmatrix/master
updating from original codebase
Diffstat (limited to 'include/deliver.php')
-rw-r--r--include/deliver.php23
1 files changed, 22 insertions, 1 deletions
diff --git a/include/deliver.php b/include/deliver.php
index 26739fb06..7a43e3d47 100644
--- a/include/deliver.php
+++ b/include/deliver.php
@@ -15,7 +15,10 @@ function deliver_run($argv, $argc) {
logger('deliver: invoked: ' . print_r($argv,true), LOGGER_DATA);
+
for($x = 1; $x < $argc; $x ++) {
+
+ $dresult = null;
$r = q("select * from outq where outq_hash = '%s' limit 1",
dbesc($argv[$x])
);
@@ -98,11 +101,29 @@ function deliver_run($argv, $argc) {
}
else {
$msg = array('body' => json_encode(array('success' => true, 'pickup' => array(array('notify' => $notify,'message' => $m)))));
- zot_import($msg,z_root());
+ $dresult = zot_import($msg,z_root());
}
$r = q("delete from outq where outq_hash = '%s'",
dbesc($argv[$x])
);
+ if($dresult && is_array($dresult)) {
+ foreach($dresult as $xx) {
+ if(is_array($xx) && array_key_exists('message_id',$xx)) {
+ q("insert into dreport ( dreport_mid, dreport_site, dreport_recip, dreport_result, dreport_time, dreport_xchan ) values ( '%s', '%s','%s','%s','%s','%s' ) ",
+ dbesc($xx['message_id']),
+ dbesc($xx['location']),
+ dbesc($xx['recipient']),
+ dbesc($xx['status']),
+ dbesc(datetime_convert($xx['date'])),
+ dbesc($xx['sender'])
+ );
+ }
+ }
+ }
+
+ q("delete from dreport where dreport_queue = '%s' limit 1",
+ dbesc($argv[$x])
+ );
}
}
else {