Update the gcontact entry when the public contact entry has changed

This commit is contained in:
Michael 2019-07-02 09:06:48 +00:00
parent a248da8f2e
commit 1d7154a7d1
4 changed files with 103 additions and 45 deletions

View file

@ -1516,6 +1516,11 @@ class Contact extends BaseObject
DBA::update('contact', $updated, ['id' => $contact_id], $contact);
if (!$background_update && ($uid == 0)) {
// Update the gcontact entry
GContact::updateFromPublicContact($contact_id);
}
return $contact_id;
}
@ -1770,6 +1775,9 @@ class Contact extends BaseObject
return;
}
// Update the corresponding gcontact entry
GContact::updateFromPublicContact($id);
// Archive or unarchive the contact. We only need to do this for the public contact.
// The archive/unarchive function will update the personal contacts by themselves.
$contact = DBA::selectFirst('contact', [], ['id' => $id]);
@ -1876,9 +1884,6 @@ class Contact extends BaseObject
self::updateContact($id, $uid, $ret['url'], $ret);
// Update the corresponding gcontact entry
GContact::updateFromProbe($ret['url']);
return true;
}