Merge pull request #7866 from annando/avoid-update
Avoid contact update for non federated networks
This commit is contained in:
commit
4f52a90d05
|
@ -1459,12 +1459,16 @@ class Contact extends BaseObject
|
||||||
$contact_id = $contact["id"];
|
$contact_id = $contact["id"];
|
||||||
|
|
||||||
// Update the contact every 7 days
|
// Update the contact every 7 days
|
||||||
|
if (in_array($contact['network'], Protocol::NATIVE_SUPPORT)) {
|
||||||
$update_contact = ($contact['updated'] < DateTimeFormat::utc('now -7 days'));
|
$update_contact = ($contact['updated'] < DateTimeFormat::utc('now -7 days'));
|
||||||
|
|
||||||
// We force the update if the avatar is empty
|
// We force the update if the avatar is empty
|
||||||
if (empty($contact['avatar'])) {
|
if (empty($contact['avatar'])) {
|
||||||
$update_contact = true;
|
$update_contact = true;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$update_contact = false;
|
||||||
|
}
|
||||||
|
|
||||||
// Update the contact in the background if needed but it is called by the frontend
|
// Update the contact in the background if needed but it is called by the frontend
|
||||||
if ($update_contact && $no_update && in_array($contact['network'], Protocol::NATIVE_SUPPORT)) {
|
if ($update_contact && $no_update && in_array($contact['network'], Protocol::NATIVE_SUPPORT)) {
|
||||||
|
|
Loading…
Reference in a new issue