Repair missing contact photos
This commit is contained in:
parent
95e65e37ee
commit
ae6748a465
1 changed files with 8 additions and 0 deletions
|
@ -1896,6 +1896,14 @@ class Contact
|
||||||
$data = [$contact["photo"], $contact["thumb"], $contact["micro"]];
|
$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) {
|
if (($contact["avatar"] != $avatar) || $force) {
|
||||||
$photos = Photo::importProfilePhoto($avatar, $uid, $cid, true);
|
$photos = Photo::importProfilePhoto($avatar, $uid, $cid, true);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue