diff options
Diffstat (limited to 'include/queue_fn.php')
-rw-r--r-- | include/queue_fn.php | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/include/queue_fn.php b/include/queue_fn.php index 5fb0d5f1e..d1c50de67 100644 --- a/include/queue_fn.php +++ b/include/queue_fn.php @@ -216,7 +216,24 @@ function queue_deliver($outq, $immediate = false) { // normal zot delivery logger('deliver: dest: ' . $outq['outq_posturl'], LOGGER_DEBUG); - $result = zot_zot($outq['outq_posturl'],$outq['outq_notify']); + + $channel = null; + + if($outq['outq_msg']) { + $msg = json_decode($outq['outq_notify'],true); + $msg['pickup'] = [ 'notify' => json_decode($outq['outq_notify'],true), 'message' => json_decode($outq['outq_msg'],true) ]; + $msg = json_encode($msg); + if($outq['outq_channel']) { + $channel = channelx_by_n($outq['outq_channel']); + } + } + else { + $msg = $outq['outq_notify']; + } + + $result = zot_zot($outq['outq_posturl'],$msg,$channel); + + if($result['success']) { logger('deliver: remote zot delivery succeeded to ' . $outq['outq_posturl']); zot_process_response($outq['outq_posturl'],$result, $outq); |