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). --- mod/post.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'mod/post.php') diff --git a/mod/post.php b/mod/post.php index cb0dc8302..919f09a35 100644 --- a/mod/post.php +++ b/mod/post.php @@ -304,9 +304,9 @@ function post_init(&$a) { * * Once decrypted, one will find the normal json_encoded zot message packet. * - * Defined packet types are: notify, purge, refresh, auth_check, ping, and pickup + * Defined packet types are: notify, purge, refresh, force_refresh, auth_check, ping, and pickup * - * Standard packet: (used by notify, purge, refresh, and auth_check) + * Standard packet: (used by notify, purge, refresh, force_refresh, and auth_check) * * { * "type": "notify", @@ -793,10 +793,13 @@ function post_post(&$a) { } } - if($msgtype === 'refresh') { + if(($msgtype === 'refresh') || ($msgtype === 'force_refresh')) { // remote channel info (such as permissions or photo or something) // has been updated. Grab a fresh copy and sync it. + // The difference between refresh and force_refresh is that + // force_refresh unconditionally creates a directory update record, + // even if no changes were detected upon processing. if($recipients) { @@ -814,7 +817,7 @@ function post_post(&$a) { 'xchan_guid' => $sender['guid'], 'xchan_guid_sig' => $sender['guid_sig'], 'hubloc_url' => $sender['url'] - ),$r[0]); + ),$r[0], (($msgtype === 'force_refresh') ? true : false)); } } else { -- cgit v1.2.3