aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-10-14 08:17:35 +0000
committerMario <mario@mariovavti.com>2020-10-14 08:17:35 +0000
commit91dd877c2d022b8939ab5602753ce247b8603c0b (patch)
tree734f6c4251f3a9bfbda9a8b264930ea82b873efb
parent89c74868aa48b97a88865e3385f7fccd6912d761 (diff)
parente2e160b8e8d01eb0d2c537318f1d738aef9df9c8 (diff)
downloadvolse-hubzilla-91dd877c2d022b8939ab5602753ce247b8603c0b.tar.gz
volse-hubzilla-91dd877c2d022b8939ab5602753ce247b8603c0b.tar.bz2
volse-hubzilla-91dd877c2d022b8939ab5602753ce247b8603c0b.zip
Merge branch 'dev' into 5.0RC
-rw-r--r--Zotlabs/Lib/Activity.php3
-rw-r--r--include/zot.php16
2 files changed, 6 insertions, 13 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index 6d12f7ea1..08e5ffaca 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -3194,11 +3194,12 @@ class Activity {
static function find_best_identity($xchan) {
if(filter_var($xchan, FILTER_VALIDATE_URL)) {
- $r = q("select hubloc_hash, hubloc_network from hubloc where hubloc_id_url = '%s'",
+ $r = q("select hubloc_hash, hubloc_network from hubloc where hubloc_id_url = '%s' and hubloc_network in ('zot6', 'zot') and hubloc_deleted = 0",
dbesc($xchan)
);
if ($r) {
$r = Libzot::zot_record_preferred($r);
+ logger('find_best_identity: ' . $xchan . ' > ' . $r['hubloc_hash']);
return $r['hubloc_hash'];
}
}
diff --git a/include/zot.php b/include/zot.php
index 38d6288cf..1a0ebdacb 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -10,6 +10,7 @@
use Zotlabs\Lib\DReport;
use Zotlabs\Lib\Libzot;
+use Zotlabs\Lib\Activity;
require_once('include/crypto.php');
require_once('include/items.php');
@@ -5370,27 +5371,18 @@ function zot_record_preferred($arr, $check = 'hubloc_network') {
function find_best_zot_identity($xchan) {
- if (filter_var($xchan, FILTER_VALIDATE_URL)) {
- $r = q("select hubloc_hash, hubloc_network from hubloc where hubloc_id_url = '%s'",
- dbesc($xchan)
- );
- if ($r) {
- $r = Libzot::zot_record_preferred($r);
- return $r['hubloc_hash'];
- }
- }
-
- $r = q("select hubloc_addr from hubloc where hubloc_hash = '%s'",
+ $r = q("select hubloc_addr from hubloc where hubloc_hash = '%s' and hubloc_network in ('zot6', 'zot') and hubloc_deleted = 0",
dbesc($xchan)
);
if ($r) {
- $r = q("select hubloc_hash, hubloc_network from hubloc where hubloc_addr = '%s'",
+ $r = q("select hubloc_hash, hubloc_network from hubloc where hubloc_addr = '%s' and hubloc_network in ('zot6', 'zot') and hubloc_deleted = 0",
dbesc($r[0]['hubloc_addr'])
);
if ($r) {
$r = Libzot::zot_record_preferred($r);
+ logger('find_best_zot_identity: ' . $xchan . ' > ' . $r['hubloc_hash']);
return $r['hubloc_hash'];
}
}