aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Daemon/Onedirsync.php2
-rw-r--r--Zotlabs/Daemon/Onepoll.php10
-rw-r--r--Zotlabs/Daemon/Poller.php11
-rw-r--r--Zotlabs/Lib/Activity.php2
-rw-r--r--Zotlabs/Lib/Apps.php2
-rw-r--r--Zotlabs/Lib/Connect.php2
-rw-r--r--Zotlabs/Module/Connedit.php11
-rw-r--r--Zotlabs/Module/Fhublocs.php17
-rw-r--r--Zotlabs/Module/Import.php59
9 files changed, 16 insertions, 100 deletions
diff --git a/Zotlabs/Daemon/Onedirsync.php b/Zotlabs/Daemon/Onedirsync.php
index f29fbe5b8..01879a470 100644
--- a/Zotlabs/Daemon/Onedirsync.php
+++ b/Zotlabs/Daemon/Onedirsync.php
@@ -72,7 +72,7 @@ class Onedirsync {
// we might have to pull this out some day, but for now update_directory_entry()
// runs zot_finger() and is kind of zot specific
- if ($h && !in_array($h['hubloc_network'], ['zot6', 'zot']))
+ if ($h && $h['hubloc_network'] !== 'zot6')
return;
Libzotdir::update_directory_entry($r[0]);
diff --git a/Zotlabs/Daemon/Onepoll.php b/Zotlabs/Daemon/Onepoll.php
index d747e65f3..0fd695e17 100644
--- a/Zotlabs/Daemon/Onepoll.php
+++ b/Zotlabs/Daemon/Onepoll.php
@@ -75,16 +75,12 @@ class Onepoll {
return;
}
- if (!in_array($contact['xchan_network'], ['zot', 'zot6']))
+ if ($contact['xchan_network'] !== 'zot6'))
return;
// update permissions
- if ($contact['xchan_network'] === 'zot6')
- $x = Libzot::refresh($contact, $importer);
-
- if ($contact['xchan_network'] === 'zot')
- $x = zot_refresh($contact, $importer);
+ $x = Libzot::refresh($contact, $importer);
$responded = false;
$updated = datetime_convert();
@@ -125,7 +121,7 @@ class Onepoll {
if (!$can_send_stream)
$fetch_feed = false;
- if ($fetch_feed && $contact['xchan_network'] !== 'zot') {
+ if ($fetch_feed) {
$max = intval(get_config('system', 'max_imported_posts', 30));
diff --git a/Zotlabs/Daemon/Poller.php b/Zotlabs/Daemon/Poller.php
index 762f1349c..88213a7c9 100644
--- a/Zotlabs/Daemon/Poller.php
+++ b/Zotlabs/Daemon/Poller.php
@@ -69,11 +69,11 @@ class Poller {
abook.abook_channel, abook.abook_id, abook.abook_archived, abook.abook_pending,
abook.abook_ignored, abook.abook_blocked,
xchan.xchan_network,
- account.account_lastlog, account.account_flags
- FROM abook LEFT JOIN xchan on abook_xchan = xchan_hash
+ account.account_lastlog, account.account_flags
+ FROM abook LEFT JOIN xchan on abook_xchan = xchan_hash
LEFT JOIN account on abook_account = account_id
where abook_self = 0
- $sql_extra
+ $sql_extra
AND (( account_flags = %d ) OR ( account_flags = %d )) $abandon_sql ORDER BY $randfunc",
intval(ACCOUNT_OK),
intval(ACCOUNT_UNVERIFIED) // FIXME
@@ -102,8 +102,7 @@ class Poller {
continue;
}
-
- if (!in_array($contact['xchan_network'], ['zot', 'zot6']))
+ if ($contact['xchan_network'] !== 'zot6')
continue;
if ($c == $t) {
@@ -191,7 +190,7 @@ class Poller {
set_config('system', 'lastpoll', datetime_convert());
- //All done - clear the lockfile
+ //All done - clear the lockfile
@unlink($lockfile);
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index 6e8344def..500e99ee8 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -3496,7 +3496,7 @@ class Activity {
static function find_best_identity($xchan) {
if (filter_var($xchan, FILTER_VALIDATE_URL)) {
- $r = q("select hubloc_hash, hubloc_network from hubloc where hubloc_id_url = '%s' and hubloc_network in ('zot6', 'zot') and hubloc_deleted = 0",
+ $r = q("select hubloc_hash, hubloc_network from hubloc where hubloc_id_url = '%s' and hubloc_network = 'zot6' and hubloc_deleted = 0",
dbesc($xchan)
);
if ($r) {
diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php
index 5ef4ecc8d..bd51f0896 100644
--- a/Zotlabs/Lib/Apps.php
+++ b/Zotlabs/Lib/Apps.php
@@ -524,7 +524,7 @@ class Apps {
}
elseif(remote_channel()) {
$observer = \App::get_observer();
- if($observer && in_array($observer['xchan_network'], ['zot6', 'zot'])) {
+ if($observer && $observer['xchan_network'] === 'zot6') {
// some folks might have xchan_url redirected offsite, use the connurl
$x = parse_url($observer['xchan_connurl']);
if($x) {
diff --git a/Zotlabs/Lib/Connect.php b/Zotlabs/Lib/Connect.php
index 21bec171b..38fe69995 100644
--- a/Zotlabs/Lib/Connect.php
+++ b/Zotlabs/Lib/Connect.php
@@ -146,7 +146,7 @@ class Connect {
}
- $allowed = ((in_array($xchan['xchan_network'],['rss','zot','zot6'])) ? 1 : 0);
+ $allowed = ((in_array($xchan['xchan_network'],['rss', 'zot6'])) ? 1 : 0);
$hookdata = ['channel_id' => $uid, 'follow_address' => $url, 'xchan' => $xchan, 'allowed' => $allowed, 'singleton' => 0];
call_hooks('follow_allow',$hookdata);
diff --git a/Zotlabs/Module/Connedit.php b/Zotlabs/Module/Connedit.php
index 44211c8b9..61fe4a889 100644
--- a/Zotlabs/Module/Connedit.php
+++ b/Zotlabs/Module/Connedit.php
@@ -478,16 +478,11 @@ class Connedit extends Controller {
}
if($cmd === 'refresh') {
- if($orig_record[0]['xchan_network'] === 'zot') {
- if(! zot_refresh($orig_record[0],App::get_channel()))
- notice( t('Refresh failed - channel is currently unavailable.') );
- }
- elseif($orig_record[0]['xchan_network'] === 'zot6') {
+ if($orig_record[0]['xchan_network'] === 'zot6') {
if(! Libzot::refresh($orig_record[0],App::get_channel()))
notice( t('Refresh failed - channel is currently unavailable.') );
}
else {
-
// if you are on a different network we'll force a refresh of the connection basic info
Master::Summon(array('Notifier','permission_update',$contact_id));
}
@@ -667,7 +662,7 @@ class Connedit extends Controller {
);
- if(in_array($contact['xchan_network'], ['zot6', 'zot'])) {
+ if($contact['xchan_network'] === 'zot6') {
$tools['fetchvc'] = [
'label' => t('Fetch Vcard'),
'url' => z_root() . '/connedit/' . $contact['abook_id'] . '/fetchvc',
@@ -841,7 +836,7 @@ class Connedit extends Controller {
$locstr = unpunify($contact['xchan_url']);
$clone_warn = '';
- $clonable = (in_array($contact['xchan_network'],['zot', 'zot6', 'rss']) ? true : false);
+ $clonable = (in_array($contact['xchan_network'], ['zot6', 'rss']);
if(! $clonable) {
$clone_warn = '<strong>';
$clone_warn .= ((intval($contact['abook_not_here']))
diff --git a/Zotlabs/Module/Fhublocs.php b/Zotlabs/Module/Fhublocs.php
index 42dac5b12..4918f751b 100644
--- a/Zotlabs/Module/Fhublocs.php
+++ b/Zotlabs/Module/Fhublocs.php
@@ -59,23 +59,6 @@ class Fhublocs extends \Zotlabs\Web\Controller {
// Create a verified hub location pointing to this site.
-/*
- $h = hubloc_store_lowlevel(
- [
- 'hubloc_guid' => $rr['channel_guid'],
- 'hubloc_guid_sig' => $rr['channel_guid_sig'],
- 'hubloc_hash' => $rr['channel_hash'],
- 'hubloc_addr' => channel_reddress($rr),
- 'hubloc_network' => 'zot',
- 'hubloc_primary' => $primary,
- 'hubloc_url' => z_root(),
- 'hubloc_url_sig' => base64url_encode(Crypto::sign(z_root(),$rr['channel_prvkey'])),
- 'hubloc_host' => \App::get_hostname(),
- 'hubloc_callback' => z_root() . '/post',
- 'hubloc_sitekey' => $sitekey
- ]
- );
-*/
$h = hubloc_store_lowlevel(
[
'hubloc_guid' => $rr['channel_guid'],
diff --git a/Zotlabs/Module/Import.php b/Zotlabs/Module/Import.php
index 4622a588d..76d4fa733 100644
--- a/Zotlabs/Module/Import.php
+++ b/Zotlabs/Module/Import.php
@@ -212,35 +212,8 @@ class Import extends \Zotlabs\Web\Controller {
// create new hubloc for the new channel at this site
if(array_key_exists('channel',$data)) {
- if($channel['channel_portable_id']) {
- $r = hubloc_store_lowlevel(
- [
- 'hubloc_guid' => $channel['channel_guid'],
- 'hubloc_guid_sig' => $channel['channel_guid_sig'],
- 'hubloc_hash' => $channel['channel_portable_id'],
- 'hubloc_addr' => channel_reddress($channel),
- 'hubloc_network' => 'zot',
- 'hubloc_primary' => (($seize) ? 1 : 0),
- 'hubloc_url' => z_root(),
- 'hubloc_url_sig' => base64url_encode(Crypto::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(),
- 'hubloc_id_url' => channel_url($channel)
- ]
- );
- // reset the original primary hubloc if it is being seized
- if($seize) {
- $r = q("update hubloc set hubloc_primary = 0 where hubloc_primary = 1 and hubloc_hash = '%s' and hubloc_url != '%s' ",
- dbesc($channel['channel_portable_id']),
- dbesc(z_root())
- );
- }
- }
-
- // create a new zot6 hubloc if we have got a channel_portable_id
+ // create a new zot6 hubloc
$r = hubloc_store_lowlevel(
[
@@ -285,28 +258,6 @@ class Import extends \Zotlabs\Web\Controller {
dbesc($channel['channel_portable_id'])
);
- if($channel['channel_portable_id']) {
- $r = xchan_store_lowlevel(
- [
- 'xchan_hash' => $channel['channel_portable_id'],
- 'xchan_guid' => $channel['channel_guid'],
- 'xchan_guid_sig' => $channel['channel_guid_sig'],
- 'xchan_pubkey' => $channel['channel_pubkey'],
- 'xchan_photo_l' => z_root() . "/photo/profile/l/" . $channel['channel_id'],
- 'xchan_photo_m' => z_root() . "/photo/profile/m/" . $channel['channel_id'],
- 'xchan_photo_s' => z_root() . "/photo/profile/s/" . $channel['channel_id'],
- 'xchan_addr' => channel_reddress($channel),
- 'xchan_url' => z_root() . '/channel/' . $channel['channel_address'],
- 'xchan_connurl' => z_root() . '/poco/' . $channel['channel_address'],
- 'xchan_follow' => z_root() . '/follow?f=&url=%s',
- 'xchan_name' => $channel['channel_name'],
- 'xchan_network' => 'zot',
- 'xchan_photo_date' => datetime_convert(),
- 'xchan_name_date' => datetime_convert()
- ]
- );
- }
-
$r = xchan_store_lowlevel(
[
'xchan_hash' => $channel['channel_hash'],
@@ -336,14 +287,6 @@ class Import extends \Zotlabs\Web\Controller {
if($xchans) {
foreach($xchans as $xchan) {
- if($xchan['xchan_network'] === 'zot') {
- $hash = make_xchan_hash($xchan['xchan_guid'],$xchan['xchan_guid_sig']);
- if($hash !== $xchan['xchan_hash']) {
- logger('forged xchan: ' . print_r($xchan,true));
- continue;
- }
- }
-
if($xchan['xchan_network'] === 'zot6') {
$zhash = Libzot::make_xchan_hash($xchan['xchan_guid'],$xchan['xchan_pubkey']);
if($zhash !== $xchan['xchan_hash']) {