diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-03-25 13:05:00 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-03-25 13:05:00 +0300 |
commit | 3fa3d45dbecafb06fb7eb4f0260f610d4225e0a7 (patch) | |
tree | 9e3a6627d747b5ef47a504275ff05de75417ccd5 /lib/pleroma/thread_mute.ex | |
parent | 012d428e1ffdd83888f339e4dbaec344202eebe1 (diff) | |
download | pleroma-3fa3d45dbecafb06fb7eb4f0260f610d4225e0a7.tar.gz |
[#1364] Minor improvements / comments.
Further fixes of incorrect usage of "relations" as a short form of "relationships".
Diffstat (limited to 'lib/pleroma/thread_mute.ex')
-rw-r--r-- | lib/pleroma/thread_mute.ex | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/pleroma/thread_mute.ex b/lib/pleroma/thread_mute.ex index 2b4cf02cf..a7ea13891 100644 --- a/lib/pleroma/thread_mute.ex +++ b/lib/pleroma/thread_mute.ex @@ -41,15 +41,16 @@ defmodule Pleroma.ThreadMute do def muter_ap_ids(context, ap_ids \\ nil) - def muter_ap_ids(context, ap_ids) when context not in [nil, ""] do + # Note: applies to fake activities (ActivityPub.Utils.get_notified_from_object/1 etc.) + def muter_ap_ids(context, _ap_ids) when is_nil(context), do: [] + + def muter_ap_ids(context, ap_ids) do context |> muters_query() |> maybe_filter_on_ap_id(ap_ids) |> Repo.all() end - def muter_ap_ids(_context, _ap_ids), do: [] - defp maybe_filter_on_ap_id(query, ap_ids) when is_list(ap_ids) do where(query, [tm, u], u.ap_id in ^ap_ids) end |