$data = [$contact["photo"], $contact["thumb"], $contact["micro"]];
}
+ foreach ($data as $image_uri) {
+ $image_rid = Photo::ridFromURI($image_uri);
+ if ($image_rid && !Photo::exists(['resource-id' => $image_rid, 'uid' => $uid])) {
+ Logger::info('Regenerating avatar for contact uid ' . $uid . ' cid ' . $cid . ' missing photo ' . $image_rid . ' avatar ' . $contact['avatar']);
+ $force = true;
+ }
+ }
+
if (($contact["avatar"] != $avatar) || $force) {
$photos = Photo::importProfilePhoto($avatar, $uid, $cid, true);