aboutsummaryrefslogtreecommitdiffstats
path: root/include/dir_fns.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-02-11 14:19:20 -0800
committerfriendica <info@friendica.com>2014-02-11 14:19:20 -0800
commitd02529fde1ee9d7ecf317ae30abce666e1b33eb4 (patch)
treef3801707655b40ea81fbe367753f1db5786432d6 /include/dir_fns.php
parent841f3922aab013ac1ae1b7715de95f8246fe4f25 (diff)
downloadvolse-hubzilla-d02529fde1ee9d7ecf317ae30abce666e1b33eb4.tar.gz
volse-hubzilla-d02529fde1ee9d7ecf317ae30abce666e1b33eb4.tar.bz2
volse-hubzilla-d02529fde1ee9d7ecf317ae30abce666e1b33eb4.zip
implement a forced directory update mode where we unconditionally create a directory sync packet. This is needed to ensure that monthly directory pings are propagated to other directory servers so they can each prove for themselves whether or not an account is alive or dead. We do not trust other directories to provide us information beyond "look at this entry and decide for yourself" as doing otherwise would invite rogue directory manipulations. As this scheduled update occurs on all channels across all servers, we should also pick up refresh messages from all existing channel clones and these should also propagate out to all directory servers using the same mechanism (though perhaps not at the same time).
Diffstat (limited to 'include/dir_fns.php')
-rw-r--r--include/dir_fns.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/include/dir_fns.php b/include/dir_fns.php
index 74e12c078..c2e614831 100644
--- a/include/dir_fns.php
+++ b/include/dir_fns.php
@@ -139,12 +139,15 @@ function update_directory_entry($ud) {
}
+/**
+ * @function local_dir_update($uid,$force)
+ * push local channel updates to a local directory server
+ *
+ */
+function local_dir_update($uid,$force) {
-
-function syncdirs($uid) {
-
- logger('syncdirs', LOGGER_DEBUG);
+ logger('local_dir_update', LOGGER_DEBUG);
$p = q("select channel.channel_hash, channel_address, channel_timezone, profile.* from profile left join channel on channel_id = uid where uid = %d and is_default = 1",
intval($uid)
@@ -222,7 +225,7 @@ function syncdirs($uid) {
}
$ud_hash = random_string() . '@' . get_app()->get_hostname();
- update_modtime($hash,$ud_hash,$p[0]['channel_address'] . '@' . get_app()->get_hostname(),1);
+ update_modtime($hash,$ud_hash,$p[0]['channel_address'] . '@' . get_app()->get_hostname(),(($force) ? (-1) : 1));
}