aboutsummaryrefslogtreecommitdiffstats
path: root/mod/import.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/import.php')
-rw-r--r--mod/import.php12
1 files changed, 5 insertions, 7 deletions
diff --git a/mod/import.php b/mod/import.php
index 088c5cb61..030b714bc 100644
--- a/mod/import.php
+++ b/mod/import.php
@@ -200,8 +200,8 @@ function import_post(&$a) {
'url' => $hubloc['hubloc_url'],
'url_sig' => $hubloc['hubloc_url_sig']
);
- if(($hubloc['hubloc_hash'] === $channel['channel_hash']) && ($hubloc['hubloc_flags'] & HUBLOC_FLAGS_PRIMARY) && ($seize))
- $hubloc['hubloc_flags'] = ($hubloc['hubloc_flags'] ^ HUBLOC_FLAGS_PRIMARY);
+ if(($hubloc['hubloc_hash'] === $channel['channel_hash']) && intval($hubloc['hubloc_primary']) && ($seize))
+ $hubloc['hubloc_primary'] = 0;
if(! zot_gethub($arr)) {
unset($hubloc['hubloc_id']);
@@ -220,7 +220,7 @@ function import_post(&$a) {
// 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_flags,
+ $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']),
@@ -228,7 +228,7 @@ function import_post(&$a) {
dbesc($channel['channel_hash']),
dbesc($channel['channel_address'] . '@' . get_app()->get_hostname()),
dbesc('zot'),
- intval(($seize) ? HUBLOC_FLAGS_PRIMARY : 0),
+ intval(($seize) ? 1 : 0),
dbesc(z_root()),
dbesc(base64url_encode(rsa_sign(z_root(),$channel['channel_prvkey']))),
dbesc(get_app()->get_hostname()),
@@ -239,9 +239,7 @@ function import_post(&$a) {
// reset the original primary hubloc if it is being seized
if($seize)
- $r = q("update hubloc set hubloc_flags = (hubloc_flags & ~%d) where (hubloc_flags & %d)>0 and hubloc_hash = '%s' and hubloc_url != '%s' ",
- intval(HUBLOC_FLAGS_PRIMARY),
- intval(HUBLOC_FLAGS_PRIMARY),
+ $r = q("update hubloc set hubloc_primary = 0 where hubloc_primary = 1 and hubloc_hash = '%s' and hubloc_url != '%s' ",
dbesc($channel['channel_hash']),
dbesc(z_root())
);