diff options
author | friendica <info@friendica.com> | 2013-12-04 00:19:29 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-12-04 00:19:29 -0800 |
commit | d8903f09f5a6d637b4258632eee16859373e1893 (patch) | |
tree | d00d8f6c5dd8032516a7577ac6b37ed6e1be22bc /include/zot.php | |
parent | 7187c493e16abc98a8e1ed53d63a3d93e63db4af (diff) | |
download | volse-hubzilla-d8903f09f5a6d637b4258632eee16859373e1893.tar.gz volse-hubzilla-d8903f09f5a6d637b4258632eee16859373e1893.tar.bz2 volse-hubzilla-d8903f09f5a6d637b4258632eee16859373e1893.zip |
include re-organisation and more doco, post_to_red fix ampersands in categories
Diffstat (limited to 'include/zot.php')
-rw-r--r-- | include/zot.php | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/include/zot.php b/include/zot.php index e365435e9..37373e7ad 100644 --- a/include/zot.php +++ b/include/zot.php @@ -863,8 +863,6 @@ function import_xchan($arr,$ud_flags = 1) { } } - - if($changed) { $guid = random_string() . '@' . get_app()->get_hostname(); update_modtime($xchan_hash,$guid,$arr['address'],$ud_flags); @@ -2103,3 +2101,24 @@ function get_rpost_path($observer) { } +function import_author_zot($x) { + $hash = base64url_encode(hash('whirlpool',$x['guid'] . $x['guid_sig'], true)); + $r = q("select hubloc_url from hubloc where hubloc_guid = '%s' and hubloc_guid_sig = '%s' and (hubloc_flags & %d) limit 1", + dbesc($x['guid']), + dbesc($x['guid_sig']), + intval(HUBLOC_FLAGS_PRIMARY) + ); + + if($r) { + logger('import_author_zot: in cache', LOGGER_DEBUG); + return $hash; + } + + logger('import_author_zot: entry 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)) + return $hash; + return false; +} + |