more specific network checking in several places and remove some old debugging crud

This commit is contained in:
zotlabs 2019-01-17 14:45:53 -08:00
parent 96deae43fa
commit 52305ca91b

View File

@ -271,7 +271,7 @@ class Libzot {
// correct hubloc. If this doesn't work we may have to re-write this section to try them all. // 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']) { if(array_key_exists('xchan_addr',$them) && $them['xchan_addr']) {
$r = q("select hubloc_id_url, hubloc_primary from hubloc where hubloc_addr = '%s' order by hubloc_id desc", $r = q("select hubloc_id_url, hubloc_primary from hubloc where hubloc_addr = '%s' and hubloc_network = 'zot6' order by hubloc_id desc",
dbesc($them['xchan_addr']) dbesc($them['xchan_addr'])
); );
} }
@ -356,7 +356,7 @@ class Libzot {
); );
if($r) { if($r) {
logger('4');
// connection exists // connection exists
// if the dob is the same as what we have stored (disregarding the year), keep the one // if the dob is the same as what we have stored (disregarding the year), keep the one
@ -1193,7 +1193,7 @@ logger('4');
//logger($AS->debug()); //logger($AS->debug());
$r = q("select hubloc_hash from hubloc where hubloc_id_url = '%s' limit 1", $r = q("select hubloc_hash from hubloc where hubloc_id_url = '%s' and hubloc_network = 'zot6' limit 1",
dbesc($AS->actor['id']) dbesc($AS->actor['id'])
); );
@ -1202,7 +1202,7 @@ logger('4');
} }
$s = q("select hubloc_hash from hubloc where hubloc_id_url = '%s' limit 1", $s = q("select hubloc_hash from hubloc where hubloc_id_url = '%s' and hubloc_network = 'zot6' limit 1",
dbesc($env['sender']) dbesc($env['sender'])
); );
@ -1515,7 +1515,9 @@ logger('4');
logger('item: ' . print_r($arr,true), LOGGER_DATA); logger('item: ' . print_r($arr,true), LOGGER_DATA);
if($arr['mid'] !== $arr['parent_mid']) { if($arr['mid'] !== $arr['parent_mid']) {
logger('checking source: "' . $arr['mid'] . '" != "' . $arr['parent_mid'] . '"'); logger('checking source: "' . $arr['mid'] . '" != "' . $arr['parent_mid'] . '"');
// check source route. // check source route.
// We are only going to accept comments from this sender if the comment has the same route as the top-level-post, // We are only going to accept comments from this sender if the comment has the same route as the top-level-post,
// this is so that permissions mismatches between senders apply to the entire conversation // this is so that permissions mismatches between senders apply to the entire conversation
@ -1600,7 +1602,7 @@ logger('checking source: "' . $arr['mid'] . '" != "' . $arr['parent_mid'] . '"')
$arr['route'] = $last_prior_route; $arr['route'] = $last_prior_route;
} }
} }
logger('hey');
$ab = q("select * from abook where abook_channel = %d and abook_xchan = '%s'", $ab = q("select * from abook where abook_channel = %d and abook_xchan = '%s'",
intval($channel['channel_id']), intval($channel['channel_id']),
dbesc($arr['owner_xchan']) dbesc($arr['owner_xchan'])
@ -1778,14 +1780,14 @@ logger('hey');
logger($AS->debug()); logger($AS->debug());
$r = q("select hubloc_hash from hubloc where hubloc_id_url = '%s' limit 1", $r = q("select hubloc_hash from hubloc where hubloc_id_url = '%s' and hubloc_network = 'zot6' limit 1",
dbesc($AS->actor['id']) dbesc($AS->actor['id'])
); );
if(! $r) { if(! $r) {
$y = import_author_xchan([ 'url' => $AS->actor['id'] ]); $y = import_author_xchan([ 'url' => $AS->actor['id'] ]);
if($y) { if($y) {
$r = q("select hubloc_hash from hubloc where hubloc_id_url = '%s' limit 1", $r = q("select hubloc_hash from hubloc where hubloc_id_url = '%s' and hubloc_network = 'zot6' limit 1",
dbesc($AS->actor['id']) dbesc($AS->actor['id'])
); );
} }
@ -1808,7 +1810,7 @@ logger('hey');
$arr['author_xchan'] = $r[0]['hubloc_hash']; $arr['author_xchan'] = $r[0]['hubloc_hash'];
} }
$s = q("select hubloc_hash from hubloc where hubloc_id_url = '%s' limit 1", $s = q("select hubloc_hash from hubloc where hubloc_id_url = '%s' and hubloc_network = 'zot6' limit 1",
dbesc($a['signature']['signer']) dbesc($a['signature']['signer'])
); );
@ -2593,7 +2595,7 @@ logger('hey');
$feed = ((x($arr,'feed')) ? intval($arr['feed']) : 0); $feed = ((x($arr,'feed')) ? intval($arr['feed']) : 0);
if($ztarget) { if($ztarget) {
$t = q("select * from hubloc where hubloc_id_url = '%s' limit 1", $t = q("select * from hubloc where hubloc_id_url = '%s' and hubloc_network = 'zot6' limit 1",
dbesc($ztarget) dbesc($ztarget)
); );
if($t) { if($t) {