aboutsummaryrefslogtreecommitdiffstats
path: root/include/queue_fn.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-02-09 06:58:12 +0100
committerMario Vavti <mario@mariovavti.com>2018-02-09 06:58:12 +0100
commit2227de5f65dcf2a1d8e3493291706ec76fb16640 (patch)
tree65941b02757b934adf96af53dc26eeed65a80b0b /include/queue_fn.php
parent384cb215beebb2cbd7ad5b32da551ebde1f3a6e0 (diff)
parent3dfafb710c901cd78b75681e39156a9f018b1ac9 (diff)
downloadvolse-hubzilla-2227de5f65dcf2a1d8e3493291706ec76fb16640.tar.gz
volse-hubzilla-2227de5f65dcf2a1d8e3493291706ec76fb16640.tar.bz2
volse-hubzilla-2227de5f65dcf2a1d8e3493291706ec76fb16640.zip
Merge remote-tracking branch 'mike/master' into dev
Diffstat (limited to 'include/queue_fn.php')
-rw-r--r--include/queue_fn.php29
1 files changed, 27 insertions, 2 deletions
diff --git a/include/queue_fn.php b/include/queue_fn.php
index 5fb0d5f1e..798ac36db 100644
--- a/include/queue_fn.php
+++ b/include/queue_fn.php
@@ -121,7 +121,7 @@ function queue_deliver($outq, $immediate = false) {
$base = null;
$h = parse_url($outq['outq_posturl']);
- if($h)
+ if($h !== false)
$base = $h['scheme'] . '://' . $h['host'] . (($h['port']) ? ':' . $h['port'] : '');
if(($base) && ($base !== z_root()) && ($immediate)) {
@@ -160,6 +160,9 @@ function queue_deliver($outq, $immediate = false) {
+
+
+
$arr = array('outq' => $outq, 'base' => $base, 'handled' => false, 'immediate' => $immediate);
call_hooks('queue_deliver',$arr);
if($arr['handled'])
@@ -216,7 +219,29 @@ 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'] && $outq['outq_channel']) {
+ $channel = channelx_by_n($outq['outq_channel']);
+ }
+
+ $host_crypto = null;
+
+ if($channel && $base) {
+ $h = q("select hubloc_sitekey, site_crypto from hubloc left join site on hubloc_url = site_url where site_url = '%s' order by hubloc_id desc limit 1",
+ dbesc($base)
+ );
+ if($h) {
+ $host_crypto = $h[0];
+ }
+ }
+
+ $msg = $outq['outq_notify'];
+
+ $result = zot_zot($outq['outq_posturl'],$msg,$channel,$host_crypto);
+
+
if($result['success']) {
logger('deliver: remote zot delivery succeeded to ' . $outq['outq_posturl']);
zot_process_response($outq['outq_posturl'],$result, $outq);