aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2023-04-28 00:58:46 +0200
committerMario Vavti <mario@mariovavti.com>2023-04-28 00:58:46 +0200
commit5412ba617dfbba9161484094427075480ae4b80c (patch)
tree6efcc334146e08415e09d7ff059351214d6ae026 /Zotlabs/Lib
parent1f81a2cb1b0974bf8fe6d0daf2c06a23f27afc98 (diff)
downloadvolse-hubzilla-5412ba617dfbba9161484094427075480ae4b80c.tar.gz
volse-hubzilla-5412ba617dfbba9161484094427075480ae4b80c.tar.bz2
volse-hubzilla-5412ba617dfbba9161484094427075480ae4b80c.zip
more dir sync testing
Diffstat (limited to 'Zotlabs/Lib')
-rw-r--r--Zotlabs/Lib/Libzotdir.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/Zotlabs/Lib/Libzotdir.php b/Zotlabs/Lib/Libzotdir.php
index d9b5d7a35..908f60765 100644
--- a/Zotlabs/Lib/Libzotdir.php
+++ b/Zotlabs/Lib/Libzotdir.php
@@ -288,7 +288,7 @@ class Libzotdir {
// the host is trusted and flags have changed
if (in_array($t['host'], $dir_trusted_hosts) &&
- $rr['site_directory'] === $t['host'] &&
+ $rr['site_url'] === $t['host'] &&
intval($r[0]['ud_flags']) !== intval($t['flags'])) {
$update = (($update) ? DIRECTORY_UPDATE_BOTH : DIRECTORY_UPDATE_FLAGS);
@@ -298,6 +298,15 @@ class Libzotdir {
continue;
}
+ if (in_array($update, [DIRECTORY_UPDATE_FLAGS, DIRECTORY_UPDATE_BOTH])) {
+ q("UPDATE updates SET ud_update = %d, ud_flags = %d WHERE ud_id = %d",
+ intval($update),
+ intval($t['flags']),
+ dbesc($r[0]['ud_id'])
+ );
+ continue;
+ }
+
q("UPDATE updates SET ud_update = %d WHERE ud_id = %d",
intval($update),
dbesc($r[0]['ud_id'])
@@ -339,14 +348,15 @@ class Libzotdir {
logger('update_directory_entry: ' . print_r($ud,true), LOGGER_DATA);
// set the flag if requested?
- if (in_array($ud['ud_flags'], [DIRECTORY_UPDATE_FLAGS, DIRECTORY_UPDATE_BOTH])) {
+ if (in_array($ud['ud_update'], [DIRECTORY_UPDATE_FLAGS, DIRECTORY_UPDATE_BOTH])) {
+
q("UPDATE xchan SET xchan_censored = %d WHERE xchan_hash = '%s'",
intval($ud['ud_flags']),
dbesc($ud['ud_hash'])
);
}
- if (intval($ud['ud_flags']) === DIRECTORY_UPDATE_FLAGS) {
+ if (intval($ud['ud_update']) === DIRECTORY_UPDATE_FLAGS) {
self::update($ud['ud_hash'], $ud['ud_addr'], $ud['ud_flags'], false);
return true;
}