aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-08-10 21:43:36 -0700
committerzotlabs <mike@macgirvin.com>2017-08-10 21:43:36 -0700
commit86c4743ed9e76f8a813f6aa8075eb68e155d85dd (patch)
treec279764d0b671daad41b2fca9e7a0bc3e780376b
parent1408e3da3bcb818134b76db338fb913ae0b54aa1 (diff)
downloadvolse-hubzilla-86c4743ed9e76f8a813f6aa8075eb68e155d85dd.tar.gz
volse-hubzilla-86c4743ed9e76f8a813f6aa8075eb68e155d85dd.tar.bz2
volse-hubzilla-86c4743ed9e76f8a813f6aa8075eb68e155d85dd.zip
deliverable_singleton - also check hubloc_hash in case we don't have an xchan_hash
-rw-r--r--include/network.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/network.php b/include/network.php
index 96f4416c8..4ea619bf5 100644
--- a/include/network.php
+++ b/include/network.php
@@ -1652,9 +1652,17 @@ function check_channelallowed($hash) {
}
function deliverable_singleton($channel_id,$xchan) {
+
+ if(array_key_exists('xchan_hash',$xchan))
+ $xchan_hash = $xchan['xchan_hash'];
+ elseif(array_key_exists('hubloc_hash',$xchan))
+ $xchan_hash = $xchan['hubloc_hash'];
+ else
+ return true;
+
$r = q("select abook_instance from abook where abook_channel = %d and abook_xchan = '%s' limit 1",
intval($channel_id),
- dbesc($xchan['xchan_hash'])
+ dbesc($xchan_hash)
);
if($r) {
if(! $r[0]['abook_instance'])