Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Properly clear cached avatars
Signed-off-by: jld3103 <[email protected]>
  • Loading branch information
provokateurin authored and backportbot-nextcloud[bot] committed May 16, 2023
commit b8286d2ead89770e83ecf1ad232c0c9d52e2fba4
9 changes: 2 additions & 7 deletions lib/private/Avatar/AvatarManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,8 @@ public function getAvatar(string $userId) : IAvatar {
public function clearCachedAvatars() {
$users = $this->config->getUsersForUserValue('avatar', 'generated', 'true');
foreach ($users as $userId) {
try {
$folder = $this->appData->getFolder($userId);
$folder->delete();
} catch (NotFoundException $e) {
$this->logger->debug("No cache for the user $userId. Ignoring...");
}
$this->config->setUserValue($userId, 'avatar', 'generated', 'false');
// This also bumps the avatar version leading to cache invalidation in browsers
$this->getAvatar($userId)->remove();
}
}

Expand Down