aboutsummaryrefslogtreecommitdiffstats
path: root/include/zot.php
diff options
context:
space:
mode:
authorHaakon Meland Eriksen <haakon.eriksen@far.no>2015-09-19 11:35:31 +0200
committerHaakon Meland Eriksen <haakon.eriksen@far.no>2015-09-19 11:35:31 +0200
commit5a7e8d8520601b3c08ef15c520da19d05b31d23b (patch)
treed6f91b9982f80d7db26beb8be953ca8f3325af85 /include/zot.php
parent1bd1050160efd88483a50c3a2a239e2160048924 (diff)
parent63146821d7f28107ca34fbe581dcc3abf6fd49fe (diff)
downloadvolse-hubzilla-5a7e8d8520601b3c08ef15c520da19d05b31d23b.tar.gz
volse-hubzilla-5a7e8d8520601b3c08ef15c520da19d05b31d23b.tar.bz2
volse-hubzilla-5a7e8d8520601b3c08ef15c520da19d05b31d23b.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'include/zot.php')
-rw-r--r--include/zot.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/include/zot.php b/include/zot.php
index ebdcb4cfb..6c5a8c289 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -296,13 +296,17 @@ function zot_refresh($them, $channel = null, $force = false) {
} else {
$r = null;
+ // if they re-installed the server we could end up with the wrong record - pointing to the old install.
+ // We'll order by reverse id to try and pick off the newest one first and hopefully end up with the
+ // correct hubloc. If this doesn't work we may have to re-write this section to try them all.
+
if(array_key_exists('xchan_addr',$them) && $them['xchan_addr']) {
- $r = q("select hubloc_url, hubloc_primary from hubloc where hubloc_addr = '%s'",
+ $r = q("select hubloc_url, hubloc_primary from hubloc where hubloc_addr = '%s' order by hubloc_id desc",
dbesc($them['xchan_addr'])
);
}
if(! $r) {
- $r = q("select hubloc_url, hubloc_primary from hubloc where hubloc_hash = '%s'",
+ $r = q("select hubloc_url, hubloc_primary from hubloc where hubloc_hash = '%s' order by hubloc_id desc",
dbesc($them['xchan_hash'])
);
}
@@ -1527,6 +1531,8 @@ function process_delivery($sender, $arr, $deliveries, $relay, $public = false, $
$result = array();
+ $result['site'] = z_root();
+
// We've validated the sender. Now make sure that the sender is the owner or author
if(! $public) {
@@ -3691,4 +3697,4 @@ function zotinfo($arr) {
}
call_hooks('zot_finger',$ret);
return($ret);
-} \ No newline at end of file
+}