diff options
author | friendica <info@friendica.com> | 2014-02-11 14:19:20 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-02-11 14:19:20 -0800 |
commit | d02529fde1ee9d7ecf317ae30abce666e1b33eb4 (patch) | |
tree | f3801707655b40ea81fbe367753f1db5786432d6 /mod | |
parent | 841f3922aab013ac1ae1b7715de95f8246fe4f25 (diff) | |
download | volse-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 'mod')
-rw-r--r-- | mod/post.php | 11 |
1 files changed, 7 insertions, 4 deletions
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 { |