aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2023-02-12 14:13:59 +0000
committerMario <mario@mariovavti.com>2023-02-12 14:13:59 +0000
commit2c459fefceb5208bba91a3acd64644fb65c78274 (patch)
tree1b09df3285cbcd07350791348ea4063fb1d715c3 /Zotlabs/Lib
parenta1eb39872ba5017be218d48f319addf3d40ff05d (diff)
downloadvolse-hubzilla-2c459fefceb5208bba91a3acd64644fb65c78274.tar.gz
volse-hubzilla-2c459fefceb5208bba91a3acd64644fb65c78274.tar.bz2
volse-hubzilla-2c459fefceb5208bba91a3acd64644fb65c78274.zip
remove deprecated functions
Diffstat (limited to 'Zotlabs/Lib')
-rw-r--r--Zotlabs/Lib/Libsync.php19
-rw-r--r--Zotlabs/Lib/Libzot.php114
2 files changed, 4 insertions, 129 deletions
diff --git a/Zotlabs/Lib/Libsync.php b/Zotlabs/Lib/Libsync.php
index 19361c4ae..b0ce7cd12 100644
--- a/Zotlabs/Lib/Libsync.php
+++ b/Zotlabs/Lib/Libsync.php
@@ -766,11 +766,10 @@ class Libsync {
*
* @param array $sender
* @param array $arr
- * @param boolean $absolute (optional) default false
* @return array
*/
- static function sync_locations($sender, $arr, $absolute = false) {
+ static function sync_locations($sender, $arr) {
$ret = [];
$what = '';
@@ -787,9 +786,6 @@ class Libsync {
if (isset($arr['locations']) && $arr['locations']) {
- if ($absolute)
- Libzot::check_location_move($sender['hash'], $arr['locations']);
-
$xisting = q("select * from hubloc where hubloc_hash = '%s'",
dbesc($sender['hash'])
);
@@ -933,14 +929,7 @@ class Libsync {
$what .= 'primary_hub ';
$changed = true;
}
- elseif ($absolute) {
- // Absolute sync - make sure the current primary is correctly reflected in the xchan
- $pr = hubloc_change_primary($r[0]);
- if ($pr) {
- $what .= 'xchan_primary ';
- $changed = true;
- }
- }
+
if (intval($r[0]['hubloc_deleted']) && (!intval($location['deleted']))) {
q("update hubloc set hubloc_deleted = 0, hubloc_updated = '%s' where hubloc_id_url = '%s'",
dbesc(datetime_convert()),
@@ -1011,10 +1000,10 @@ class Libsync {
// get rid of any hubs we have for this channel which weren't reported.
- if ($absolute && $xisting) {
+ if ($xisting) {
foreach ($xisting as $x) {
if (!array_key_exists('updated', $x)) {
- logger('Deleting unreferenced hub location ' . $x['hubloc_addr']);
+ hz_syslog('Deleting unreferenced hub location ' . $x['hubloc_addr']);
q("update hubloc set hubloc_deleted = 1, hubloc_updated = '%s' where hubloc_id_url = '%s'",
dbesc(datetime_convert()),
dbesc($x['hubloc_id_url'])
diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php
index c2787e03c..5610a21b2 100644
--- a/Zotlabs/Lib/Libzot.php
+++ b/Zotlabs/Lib/Libzot.php
@@ -2307,120 +2307,6 @@ class Libzot {
/**
- * @brief Processes delivery of profile.
- *
- * @param string $sender
- * @param array $arr
- * @param array $deliveries (unused)
- * @return void
- * @see import_directory_profile()
- *
- */
- static function process_profile_delivery($sender, $arr, $deliveries) {
-
- logger('process_profile_delivery', LOGGER_DEBUG);
-
- $r = q("select xchan_addr from xchan where xchan_hash = '%s' limit 1",
- dbesc($sender)
- );
- if ($r) {
- Libzotdir::import_directory_profile($sender, $arr, $r[0]['xchan_addr'], UPDATE_FLAGS_UPDATED, 0);
- }
- }
-
-
- /**
- * @brief
- *
- * @param string $sender
- * @param array $arr
- * @param array $deliveries (unused) deliveries is irrelevant
- * @return void
- */
- static function process_location_delivery($sender, $arr, $deliveries) {
-
- // deliveries is irrelevant
- logger('process_location_delivery', LOGGER_DEBUG);
-
- $r = q("select * from xchan where xchan_hash = '%s' limit 1",
- dbesc($sender)
- );
- if ($r) {
- $xchan = ['id' => $r[0]['xchan_guid'], 'id_sig' => $r[0]['xchan_guid_sig'],
- 'hash' => $r[0]['xchan_hash'], 'public_key' => $r[0]['xchan_pubkey']];
- }
- if (array_key_exists('locations', $arr) && $arr['locations']) {
- $x = Libsync::sync_locations($xchan, $arr, true);
- logger('results: ' . print_r($x, true), LOGGER_DEBUG);
- if ($x['changed']) {
- //$guid = random_string() . '@' . App::get_hostname();
- Libzotdir::update_modtime($sender, $r[0]['xchan_guid'], $arr['locations'][0]['address'], UPDATE_FLAGS_UPDATED);
- }
- }
- }
-
- /**
- * @brief Checks for a moved channel and sets the channel_moved flag.
- *
- * Currently the effect of this flag is to turn the channel into 'read-only' mode.
- * New content will not be processed (there was still an issue with blocking the
- * ability to post comments as of 10-Mar-2016).
- * We do not physically remove the channel at this time. The hub admin may choose
- * to do so, but is encouraged to allow a grace period of several days in case there
- * are any issues migrating content. This packet will generally be received by the
- * original site when the basic channel import has been processed.
- *
- * This will only be executed on the old location
- * if a new location is reported and there is only one location record.
- * The rest of the hubloc syncronisation will be handled within
- * sync_locations
- *
- * @param string $sender_hash A channel hash
- * @param array $locations
- * @return void
- */
- static function check_location_move($sender_hash, $locations) {
-
- if (!$locations)
- return;
-
- if (count($locations) != 1)
- return;
-
- $loc = $locations[0];
-
- $r = q("select * from channel where channel_hash = '%s' limit 1",
- dbesc($sender_hash)
- );
-
- if (!$r)
- return;
-
- if ($loc['url'] !== z_root()) {
- $x = q("update channel set channel_moved = '%s' where channel_hash = '%s' limit 1",
- dbesc($loc['url']),
- dbesc($sender_hash)
- );
-
- // federation plugins may wish to notify connections
- // of the move on singleton networks
-
- $arr = [
- 'channel' => $r[0],
- 'locations' => $locations
- ];
- /**
- * @hooks location_move
- * Called when a new location has been provided to a UNO channel (indicating a move rather than a clone).
- * * \e array \b channel
- * * \e array \b locations
- */
- call_hooks('location_move', $arr);
- }
- }
-
-
- /**
* @brief Returns an array with all known distinct hubs for this channel.
*
* @param array $channel an associative array which must contain