diff options
author | zotlabs <mike@macgirvin.com> | 2017-01-30 15:01:22 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-01-30 15:01:22 -0800 |
commit | 7b065365e0d64a06ddfb7ade55e713a4b6a0f802 (patch) | |
tree | 319929299a1e92c95f6fc56da778893b30ace349 /Zotlabs/Module/Import.php | |
parent | eebea700193155b176ee9a9b338f1a0ad4b6aa40 (diff) | |
download | volse-hubzilla-7b065365e0d64a06ddfb7ade55e713a4b6a0f802.tar.gz volse-hubzilla-7b065365e0d64a06ddfb7ade55e713a4b6a0f802.tar.bz2 volse-hubzilla-7b065365e0d64a06ddfb7ade55e713a4b6a0f802.zip |
consolidate hubloc storage
Diffstat (limited to 'Zotlabs/Module/Import.php')
-rw-r--r-- | Zotlabs/Module/Import.php | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/Zotlabs/Module/Import.php b/Zotlabs/Module/Import.php index 6de7c85a2..c28cf8770 100644 --- a/Zotlabs/Module/Import.php +++ b/Zotlabs/Module/Import.php @@ -206,23 +206,24 @@ class Import extends \Zotlabs\Web\Controller { if($completed < 5) { // create new hubloc for the new channel at this site - - $r = q("insert into hubloc ( hubloc_guid, hubloc_guid_sig, hubloc_hash, hubloc_addr, hubloc_network, hubloc_primary, - hubloc_url, hubloc_url_sig, hubloc_host, hubloc_callback, hubloc_sitekey ) - values ( '%s', '%s', '%s', '%s', '%s', %d, '%s', '%s', '%s', '%s', '%s' )", - dbesc($channel['channel_guid']), - dbesc($channel['channel_guid_sig']), - dbesc($channel['channel_hash']), - dbesc(channel_reddress($channel)), - dbesc('zot'), - intval(($seize) ? 1 : 0), - dbesc(z_root()), - dbesc(base64url_encode(rsa_sign(z_root(),$channel['channel_prvkey']))), - dbesc(\App::get_hostname()), - dbesc(z_root() . '/post'), - dbesc(get_config('system','pubkey')) + + $r = hubloc_store_lowelevel( + [ + 'hubloc_guid' => $channel['channel_guid'], + 'hubloc_guid_sig' => $channel['channel_guid_sig'], + 'hubloc_hash' => $channel['channel_hash'], + 'hubloc_addr' => channel_reddress($channel), + 'hubloc_network' => 'zot', + 'hubloc_primary' => (($seize) ? 1 : 0), + 'hubloc_url' => z_root(), + 'hubloc_url_sig' => base64url_encode(rsa_sign(z_root(),$channel['channel_prvkey'])), + 'hubloc_host' => \App::get_hostname(), + 'hubloc_callback' => z_root() . '/post', + 'hubloc_sitekey' => get_config('system','pubkey'), + 'hubloc_updated' => datetime_convert() + ] ); - + // reset the original primary hubloc if it is being seized if($seize) { |