and i yoink (#275)
[akkoma] / lib / pleroma / workers / mute_expire_worker.ex
index c8b44894e91f9a110e66329a10a9da98feb75e1a..8da903e761055f72182d07ae09d2b3b4f198283b 100644 (file)
@@ -1,5 +1,5 @@
 # Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
 defmodule Pleroma.Workers.MuteExpireWorker do
@@ -7,18 +7,14 @@ defmodule Pleroma.Workers.MuteExpireWorker do
 
   @impl Oban.Worker
   def perform(%Job{args: %{"op" => "unmute_user", "muter_id" => muter_id, "mutee_id" => mutee_id}}) do
-    muter = Pleroma.User.get_by_id(muter_id)
-    mutee = Pleroma.User.get_by_id(mutee_id)
-    Pleroma.User.unmute(muter, mutee)
+    Pleroma.User.unmute(muter_id, mutee_id)
     :ok
   end
 
   def perform(%Job{
         args: %{"op" => "unmute_conversation", "user_id" => user_id, "activity_id" => activity_id}
       }) do
-    user = Pleroma.User.get_by_id(user_id)
-    activity = Pleroma.Activity.get_by_id(activity_id)
-    Pleroma.Web.CommonAPI.remove_mute(user, activity)
+    Pleroma.Web.CommonAPI.remove_mute(user_id, activity_id)
     :ok
   end
 end