aboutsummaryrefslogtreecommitdiffstats
path: root/include/deliver.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/deliver.php')
-rw-r--r--include/deliver.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/include/deliver.php b/include/deliver.php
index 8f6ba543d..47d8562df 100644
--- a/include/deliver.php
+++ b/include/deliver.php
@@ -24,13 +24,13 @@ function deliver_run($argv, $argc) {
$result = z_post_url($r[0]['outq_posturl'],$r[0]['outq_msg']);
if($result['success'] && $result['return_code'] < 300) {
logger('deliver: queue post success to ' . $r[0]['outq_posturl'], LOGGER_DEBUG);
- $y = q("delete from outq where outq_hash = '%s' limit 1",
+ $y = q("delete from outq where outq_hash = '%s'",
dbesc($argv[$x])
);
}
else {
logger('deliver: queue post returned ' . $result['return_code'] . ' from ' . $r[0]['outq_posturl'],LOGGER_DEBUG);
- $y = q("update outq set outq_updated = '%s' where outq_hash = '%s' limit 1",
+ $y = q("update outq set outq_updated = '%s' where outq_hash = '%s'",
dbesc(datetime_convert()),
dbesc($argv[$x])
);
@@ -40,6 +40,10 @@ function deliver_run($argv, $argc) {
$notify = json_decode($r[0]['outq_notify'],true);
+ // Check if this is a conversation request packet. It won't have outq_msg
+ // but will be an encrypted packet - so will need to be handed off to
+ // web delivery rather than processed inline.
+
$sendtoweb = false;
if(array_key_exists('iv',$notify) && (! $r[0]['outq_msg']))
$sendtoweb = true;
@@ -48,8 +52,7 @@ function deliver_run($argv, $argc) {
logger('deliver: local delivery', LOGGER_DEBUG);
// local delivery
// we should probably batch these and save a few delivery processes
- // If there is no outq_msg, this is a refresh_all message which does not require local handling
- // also send 'request' packets to the webservice so it can decode the packet
+
if($r[0]['outq_msg']) {
$m = json_decode($r[0]['outq_msg'],true);
if(array_key_exists('message_list',$m)) {
@@ -62,7 +65,7 @@ function deliver_run($argv, $argc) {
$msg = array('body' => json_encode(array('pickup' => array(array('notify' => $notify,'message' => $m)))));
zot_import($msg,z_root());
}
- $r = q("delete from outq where outq_hash = '%s' limit 1",
+ $r = q("delete from outq where outq_hash = '%s'",
dbesc($argv[$x])
);
}
@@ -74,7 +77,7 @@ function deliver_run($argv, $argc) {
zot_process_response($r[0]['outq_posturl'],$result, $r[0]);
}
else {
- $y = q("update outq set outq_updated = '%s' where outq_hash = '%s' limit 1",
+ $y = q("update outq set outq_updated = '%s' where outq_hash = '%s'",
dbesc(datetime_convert()),
dbesc($argv[$x])
);