aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/common_api
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2019-12-02 16:26:19 +0000
committerlain <lain@soykaf.club>2019-12-02 16:26:19 +0000
commit7722e5a67a46304f3ae0e37f674a44ca9268be5e (patch)
tree504f7b7623c6917fcfa567050d80153e2f2aee11 /lib/pleroma/web/common_api
parentd468cba2d56f60a41b0372a381b1017a8d2d046b (diff)
parent1fc28a4b441fdc0de8b2b43e2b045da38ee50b0a (diff)
downloadpleroma-7722e5a67a46304f3ae0e37f674a44ca9268be5e.tar.gz
Merge branch 'feature/move-activity' into 'develop'
Support "Move" activity Closes #1316 See merge request pleroma/pleroma!1883
Diffstat (limited to 'lib/pleroma/web/common_api')
-rw-r--r--lib/pleroma/web/common_api/utils.ex13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/pleroma/web/common_api/utils.ex b/lib/pleroma/web/common_api/utils.ex
index 88a5f434a..cbb64f8d2 100644
--- a/lib/pleroma/web/common_api/utils.ex
+++ b/lib/pleroma/web/common_api/utils.ex
@@ -451,6 +451,8 @@ defmodule Pleroma.Web.CommonAPI.Utils do
recipients ++ to
end
+ def maybe_notify_to_recipients(recipients, _), do: recipients
+
def maybe_notify_mentioned_recipients(
recipients,
%Activity{data: %{"to" => _to, "type" => type} = data} = activity
@@ -502,6 +504,17 @@ defmodule Pleroma.Web.CommonAPI.Utils do
def maybe_notify_subscribers(recipients, _), do: recipients
+ def maybe_notify_followers(recipients, %Activity{data: %{"type" => "Move"}} = activity) do
+ with %User{} = user <- User.get_cached_by_ap_id(activity.actor) do
+ user
+ |> User.get_followers()
+ |> Enum.map(& &1.ap_id)
+ |> Enum.concat(recipients)
+ end
+ end
+
+ def maybe_notify_followers(recipients, _), do: recipients
+
def maybe_extract_mentions(%{"tag" => tag}) do
tag
|> Enum.filter(fn x -> is_map(x) && x["type"] == "Mention" end)