projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b9871e7
)
notification: add fallback get_notified_from_activity()
author
William Pitcock
<nenolod@dereferenced.org>
Fri, 9 Nov 2018 09:07:40 +0000
(09:07 +0000)
committer
William Pitcock
<nenolod@dereferenced.org>
Fri, 9 Nov 2018 09:07:40 +0000
(09:07 +0000)
lib/pleroma/notification.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/notification.ex
b/lib/pleroma/notification.ex
index ca4113d315f7df9ac353486080b8c1d46a47d477..a3aeb1221f3216d5d6206c0d1308dba95073a6db 100644
(file)
--- a/
lib/pleroma/notification.ex
+++ b/
lib/pleroma/notification.ex
@@
-114,9
+114,11
@@
defmodule Pleroma.Notification do
end
end
+ def get_notified_from_activity(activity, local_only \\ true)
+
def get_notified_from_activity(
%Activity{data: %{"to" => _, "type" => type} = data} = activity,
- local_only
\\ true
+ local_only
)
when type in ["Create", "Like", "Announce", "Follow"] do
recipients =
@@
-128,6
+130,8
@@
defmodule Pleroma.Notification do
User.get_users_from_set(recipients, local_only)
end
+ def get_notified_from_activity(_, local_only), do: []
+
defp maybe_notify_to_recipients(
recipients,
%Activity{data: %{"to" => to, "type" => type}} = activity