From d02529fde1ee9d7ecf317ae30abce666e1b33eb4 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 11 Feb 2014 14:19:20 -0800 Subject: 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). --- include/dir_fns.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'include/dir_fns.php') 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)); } -- cgit v1.2.3