Merge pull request #7866 from annando/avoid-update

Avoid contact update for non federated networks
This commit is contained in:
Tobias Diekershoff 2019-11-25 10:25:45 +01:00 committed by GitHub
commit 4f52a90d05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 4 deletions

View File

@ -1459,11 +1459,15 @@ class Contact extends BaseObject
$contact_id = $contact["id"];
// Update the contact every 7 days
$update_contact = ($contact['updated'] < DateTimeFormat::utc('now -7 days'));
if (in_array($contact['network'], Protocol::NATIVE_SUPPORT)) {
$update_contact = ($contact['updated'] < DateTimeFormat::utc('now -7 days'));
// We force the update if the avatar is empty
if (empty($contact['avatar'])) {
$update_contact = true;
// We force the update if the avatar is empty
if (empty($contact['avatar'])) {
$update_contact = true;
}
} else {
$update_contact = false;
}
// Update the contact in the background if needed but it is called by the frontend