aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRoger Braun <roger@rogerbraun.net>2017-09-11 20:43:25 +0200
committerRoger Braun <roger@rogerbraun.net>2017-09-11 20:43:25 +0200
commit3bad294058b630a4542adc869f9646ba3364fd7a (patch)
tree2973ab5fedfe6e677604632ce9aee1e721de82b8 /lib
parentbcce3e5dd2c9ba262d73d398f3e8a14eee21f009 (diff)
downloadpleroma-3bad294058b630a4542adc869f9646ba3364fd7a.tar.gz
Add reblogs to notifications.
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/notification.ex2
-rw-r--r--lib/pleroma/web/mastodon_api/mastodon_api_controller.ex3
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/pleroma/notification.ex b/lib/pleroma/notification.ex
index 031f71091..8cd09ad8e 100644
--- a/lib/pleroma/notification.ex
+++ b/lib/pleroma/notification.ex
@@ -20,7 +20,7 @@ defmodule Pleroma.Notification do
Repo.all(query)
end
- def create_notifications(%Activity{id: id, data: %{"to" => to, "type" => type}} = activity) when type in ["Create", "Like"] do
+ def create_notifications(%Activity{id: id, data: %{"to" => to, "type" => type}} = activity) when type in ["Create", "Like", "Announce"] do
users = User.get_notified_from_activity(activity)
notifications = Enum.map(users, fn (user) -> create_notification(activity, user) end)
diff --git a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
index 3804a39f0..811162196 100644
--- a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
+++ b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
@@ -142,6 +142,9 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
"Like" ->
liked_activity = Activity.get_create_activity_by_object_ap_id(activity.data["object"])
%{id: id, type: "favourite", created_at: created_at, account: AccountView.render("account.json", %{user: actor}), status: StatusView.render("status.json", %{activity: liked_activity})}
+ "Announce" ->
+ announced_activity = Activity.get_create_activity_by_object_ap_id(activity.data["object"])
+ %{id: id, type: "reblog", created_at: created_at, account: AccountView.render("account.json", %{user: actor}), status: StatusView.render("status.json", %{activity: announced_activity})}
_ -> nil
end
end)