From 806352db1d17b4566ed036b7e68e16ce5e417da7 Mon Sep 17 00:00:00 2001 From: Mint <> Date: Sun, 30 Apr 2023 13:55:35 +0300 Subject: [PATCH] Use get_cached just in case --- lib/pleroma/web/activity_pub/mrf/high_roller_policy.ex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pleroma/web/activity_pub/mrf/high_roller_policy.ex b/lib/pleroma/web/activity_pub/mrf/high_roller_policy.ex index f75756076..50b21ea78 100644 --- a/lib/pleroma/web/activity_pub/mrf/high_roller_policy.ex +++ b/lib/pleroma/web/activity_pub/mrf/high_roller_policy.ex @@ -95,7 +95,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.HighRollerPolicy do if (systime > actiontime && globalcount < Config.get([:mrf_high_roller, :global_threshold])) do Cachex.incr(:highroller, "global:"<>actor.nickname, globalcount+1) Cachex.put(:highroller, actor.nickname<>","<>recipient.nickname<>","<>action, systime+Config.get([:mrf_high_roller, :timeout])) - CommonAPI.post(User.get_by_nickname(Config.get([:mrf_high_roller, :user])), %{ + CommonAPI.post(User.get_cached_by_nickname(Config.get([:mrf_high_roller, :user])), %{ status: msg, visibility: Config.get([:mrf_high_roller, :block_visibility]) }) @@ -159,7 +159,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.HighRollerPolicy do if (systime > actiontime && globalcount < Config.get([:mrf_high_roller, :global_threshold])) do Cachex.incr(:highroller, "global:"<>actor.nickname, globalcount+1) Cachex.put(:highroller, actor.nickname<>","<>recipient.nickname<>",report", systime+Config.get([:mrf_high_roller, :timeout])) - CommonAPI.post(User.get_by_nickname(Config.get([:mrf_high_roller, :user])), %{ + CommonAPI.post(User.get_cached_by_nickname(Config.get([:mrf_high_roller, :user])), %{ status: msg <> comment <> posts, visibility: Config.get([:mrf_high_roller, :report_visibility]) }) @@ -203,7 +203,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.HighRollerPolicy do if (systime > actiontime && globalcount < Config.get([:mrf_high_roller, :global_threshold])) do Cachex.incr(:highroller, "global:"<>actor.nickname, globalcount+1) Cachex.put(:highroller, actor.nickname<>","<>recipient.nickname<>",unfollow", systime+Config.get([:mrf_high_roller, :timeout])) - CommonAPI.post(User.get_by_nickname(Config.get([:mrf_high_roller, :user])), %{ + CommonAPI.post(User.get_cached_by_nickname(Config.get([:mrf_high_roller, :user])), %{ status: msg, visibility: Config.get([:mrf_high_roller, :unfollow_visibility]) })