diff options
author | Roger Braun <roger@rogerbraun.net> | 2017-09-11 20:53:11 +0200 |
---|---|---|
committer | Roger Braun <roger@rogerbraun.net> | 2017-09-11 20:53:11 +0200 |
commit | 464c33e9a1daf0477be050209043d2c26943d1fd (patch) | |
tree | a7efdfedead6878f9bc1131292b09e1b0169e0d9 /lib | |
parent | 3bad294058b630a4542adc869f9646ba3364fd7a (diff) | |
download | pleroma-464c33e9a1daf0477be050209043d2c26943d1fd.tar.gz |
Add follow notifications.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/notification.ex | 2 | ||||
-rw-r--r-- | lib/pleroma/web/mastodon_api/mastodon_api_controller.ex | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/pleroma/notification.ex b/lib/pleroma/notification.ex index 8cd09ad8e..4a9e835bf 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", "Announce"] do + def create_notifications(%Activity{id: id, data: %{"to" => to, "type" => type}} = activity) when type in ["Create", "Like", "Announce", "Follow"] 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 811162196..9e4d13b3a 100644 --- a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex +++ b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex @@ -145,6 +145,8 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do "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})} + "Follow" -> + %{id: id, type: "follow", created_at: created_at, account: AccountView.render("account.json", %{user: actor})} _ -> nil end end) |