Repair missing contact photos
This commit is contained in:
parent
95e65e37ee
commit
ae6748a465
|
@ -1896,6 +1896,14 @@ class Contact
|
|||
$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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user