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 <jld3103yt@gmail.com>
  • Loading branch information
provokateurin authored and backportbot-nextcloud[bot] committed May 16, 2023
commit 2374aea9dd175ef43078536d493ef99edcfc79e1
9 changes: 2 additions & 7 deletions lib/private/Avatar/AvatarManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,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