Skip to content

Commit

Permalink
Merge pull request #5868 from WoltLab/bugfix/user-ignore-cache-reset
Browse files Browse the repository at this point in the history
Reset cache for the user who is no longer ignored
  • Loading branch information
Cyperghost authored Apr 4, 2024
2 parents bba7897 + 2571bf1 commit f5201fc
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ public function unignore()
$ignoreEditor->delete();

UserStorageHandler::getInstance()->reset([WCF::getUser()->userID], 'ignoredUserIDs');
UserStorageHandler::getInstance()->reset([$this->parameters['data']['userID']], 'ignoredByUserIDs');
}

return ['isIgnoredUser' => 0];
Expand Down Expand Up @@ -297,10 +298,15 @@ public function validateDelete()
*/
public function delete()
{
$userIDs = \array_map(function ($ignore) {
return $ignore->ignoreUserID;
}, $this->getObjects());

$returnValues = parent::delete();

// reset storage
UserStorageHandler::getInstance()->reset([WCF::getUser()->userID], 'ignoredUserIDs');
UserStorageHandler::getInstance()->reset($userIDs, 'ignoredByUserIDs');

return $returnValues;
}
Expand Down

0 comments on commit f5201fc

Please sign in to comment.