Merge pull request #12670 from annando/fix-avatar-cache
Ensure to reset the avatar paths when deleting avatar cache
This commit is contained in:
commit
2d555b60dd
|
@ -246,13 +246,16 @@ class Avatar
|
||||||
* Delete locally cached avatar pictures of a contact
|
* Delete locally cached avatar pictures of a contact
|
||||||
*
|
*
|
||||||
* @param string $avatar
|
* @param string $avatar
|
||||||
* @return void
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function deleteCache(array $contact)
|
public static function deleteCache(array $contact): bool
|
||||||
{
|
{
|
||||||
|
$existed = (self::isCacheFile($contact['photo']) || self::isCacheFile($contact['thumb']) || self::isCacheFile($contact['micro']));
|
||||||
self::deleteCacheFile($contact['photo']);
|
self::deleteCacheFile($contact['photo']);
|
||||||
self::deleteCacheFile($contact['thumb']);
|
self::deleteCacheFile($contact['thumb']);
|
||||||
self::deleteCacheFile($contact['micro']);
|
self::deleteCacheFile($contact['micro']);
|
||||||
|
|
||||||
|
return $existed;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2252,7 +2252,9 @@ class Contact
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array($contact['network'], [Protocol::FEED, Protocol::MAIL]) || $cache_avatar) {
|
if (in_array($contact['network'], [Protocol::FEED, Protocol::MAIL]) || $cache_avatar) {
|
||||||
Avatar::deleteCache($contact);
|
if (Avatar::deleteCache($contact)) {
|
||||||
|
$force = true;
|
||||||
|
}
|
||||||
|
|
||||||
if ($default_avatar && Proxy::isLocalImage($avatar)) {
|
if ($default_avatar && Proxy::isLocalImage($avatar)) {
|
||||||
$fields = ['avatar' => $avatar, 'avatar-date' => DateTimeFormat::utcNow(),
|
$fields = ['avatar' => $avatar, 'avatar-date' => DateTimeFormat::utcNow(),
|
||||||
|
|
Loading…
Reference in a new issue