From: Haelwenn (lanodan) Monnier Date: Thu, 1 Nov 2018 05:52:01 +0000 (+0100) Subject: [Pleroma.Web.CommonAPI]: Delete post cache entry when it’s deleted X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=558e6a84d6750cc245e6656ab12e9e8bbb4f256c;p=akkoma [Pleroma.Web.CommonAPI]: Delete post cache entry when it’s deleted Closes: https://git.pleroma.social/pleroma/pleroma/issues/346 --- diff --git a/lib/pleroma/web/common_api/common_api.ex b/lib/pleroma/web/common_api/common_api.ex index 8f47bb127..8607cb6b3 100644 --- a/lib/pleroma/web/common_api/common_api.ex +++ b/lib/pleroma/web/common_api/common_api.ex @@ -9,7 +9,8 @@ defmodule Pleroma.Web.CommonAPI do with %Activity{data: %{"object" => %{"id" => object_id}}} <- Repo.get(Activity, activity_id), %Object{} = object <- Object.normalize(object_id), true <- user.info["is_moderator"] || user.ap_id == object.data["actor"], - {:ok, delete} <- ActivityPub.delete(object) do + {:ok, delete} <- ActivityPub.delete(object), + {:ok, true} <- Cachex.del(:user_cache, "object:#{object_id}") do {:ok, delete} end end