More avatar handling isolation
This commit is contained in:
parent
681d19a3bc
commit
006b7a95f0
|
@ -129,7 +129,7 @@ class Avatar
|
|||
* @param string $avatar
|
||||
* @return boolean
|
||||
*/
|
||||
public static function isCacheFile(string $avatar): bool
|
||||
private static function isCacheFile(string $avatar): bool
|
||||
{
|
||||
return !empty(self::getCacheFile($avatar));
|
||||
}
|
||||
|
|
|
@ -1581,10 +1581,14 @@ class Contact
|
|||
self::updateAvatar($cid, $contact['avatar'], true);
|
||||
return;
|
||||
}
|
||||
} elseif (!Avatar::isCacheFile($contact['photo']) || !Avatar::isCacheFile($contact['thumb']) || !Avatar::isCacheFile($contact['micro'])) {
|
||||
Logger::info('Removing/replacing avatar cache', ['id' => $cid, 'contact' => $contact]);
|
||||
} elseif (Photo::isPhotoURI($contact['photo']) || Photo::isPhotoURI($contact['thumb']) || Photo::isPhotoURI($contact['micro'])) {
|
||||
Logger::info('Replacing legacy avatar cache', ['id' => $cid, 'contact' => $contact]);
|
||||
self::updateAvatar($cid, $contact['avatar'], true);
|
||||
return;
|
||||
} elseif (DI::config()->get('system', 'avatar_cache') && (empty($contact['photo']) || empty($contact['thumb']) || empty($contact['micro']))) {
|
||||
Logger::info('Adding avatar cache file', ['id' => $cid, 'contact' => $contact]);
|
||||
self::updateAvatar($cid, $contact['avatar'], true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user