diff options
author | zotlabs <mike@macgirvin.com> | 2017-04-03 15:55:22 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-04-03 15:55:22 -0700 |
commit | f2f2b534e611c37105b1dc56470735c13641c944 (patch) | |
tree | 2eed3379df931bccd56dd7be8e3a56394fa3e0f9 /include/zot.php | |
parent | 2d9ae8ff2c581b8981c9c7308c4cf98bfee934b1 (diff) | |
parent | a9bda2b12e3d393fa854e23207a081052e2e7bfd (diff) | |
download | volse-hubzilla-f2f2b534e611c37105b1dc56470735c13641c944.tar.gz volse-hubzilla-f2f2b534e611c37105b1dc56470735c13641c944.tar.bz2 volse-hubzilla-f2f2b534e611c37105b1dc56470735c13641c944.zip |
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge
Diffstat (limited to 'include/zot.php')
-rw-r--r-- | include/zot.php | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/include/zot.php b/include/zot.php index 8a2178913..266060839 100644 --- a/include/zot.php +++ b/include/zot.php @@ -165,9 +165,6 @@ function zot_build_packet($channel, $type = 'notify', $recipients = null, $remot function zot_best_algorithm($methods) { - if(\Zotlabs\Lib\System::get_server_role() !== 'pro') - return 'aes256cbc'; - $x = [ 'methods' => $methods, 'result' => '' ]; call_hooks('zot_best_algorithm',$x); if($x['result']) @@ -3581,21 +3578,30 @@ function get_rpost_path($observer) { function import_author_zot($x) { + // Check that we have both a hubloc and xchan record - as occasionally storage calls will fail and + // we may only end up with one; which results in posts with no author name or photo and are a bit + // of a hassle to repair. If either or both are missing, do a full discovery probe. + $hash = make_xchan_hash($x['guid'],$x['guid_sig']); - $r = q("select hubloc_url from hubloc where hubloc_guid = '%s' and hubloc_guid_sig = '%s' and hubloc_primary = 1 limit 1", + $r1 = q("select hubloc_url from hubloc where hubloc_guid = '%s' and hubloc_guid_sig = '%s' and hubloc_primary = 1 limit 1", dbesc($x['guid']), dbesc($x['guid_sig']) ); - if ($r) { - logger('import_author_zot: in cache', LOGGER_DEBUG); + $r2 = q("select xchan_hash from xchan where xchan_guid = '%s' and xchan_guid_sig = '%s' limit 1", + dbesc($x['guid']), + dbesc($x['guid_sig']) + ); + + if($r1 && $r2) { + logger('in cache', LOGGER_DEBUG); return $hash; } - logger('import_author_zot: entry not in cache - probing: ' . print_r($x,true), LOGGER_DEBUG); + logger('not in cache - probing: ' . print_r($x,true), LOGGER_DEBUG); $them = array('hubloc_url' => $x['url'], 'xchan_guid' => $x['guid'], 'xchan_guid_sig' => $x['guid_sig']); - if (zot_refresh($them)) + if(zot_refresh($them)) return $hash; return false; |