projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'develop' of https://git.pleroma.social/pleroma/pleroma into develop
[akkoma]
/
lib
/
pleroma
/
web
/
mastodon_api
/
controllers
/
notification_controller.ex
diff --git
a/lib/pleroma/web/mastodon_api/controllers/notification_controller.ex
b/lib/pleroma/web/mastodon_api/controllers/notification_controller.ex
index bcd12c73f74678e36897152c6d982691520a30af..002d6b2cea48762b61eabc927cde7adfacc7da57 100644
(file)
--- a/
lib/pleroma/web/mastodon_api/controllers/notification_controller.ex
+++ b/
lib/pleroma/web/mastodon_api/controllers/notification_controller.ex
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-202
0
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-202
1
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.MastodonAPI.NotificationController do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.MastodonAPI.NotificationController do
@@
-8,8
+8,8
@@
defmodule Pleroma.Web.MastodonAPI.NotificationController do
import Pleroma.Web.ControllerHelper, only: [add_link_headers: 2]
alias Pleroma.Notification
import Pleroma.Web.ControllerHelper, only: [add_link_headers: 2]
alias Pleroma.Notification
- alias Pleroma.Plugs.OAuthScopesPlug
alias Pleroma.Web.MastodonAPI.MastodonAPI
alias Pleroma.Web.MastodonAPI.MastodonAPI
+ alias Pleroma.Web.Plugs.OAuthScopesPlug
@oauth_read_actions [:show, :index]
@oauth_read_actions [:show, :index]
@@
-42,8
+42,21
@@
defmodule Pleroma.Web.MastodonAPI.NotificationController do
end
end
end
end
+ @default_notification_types ~w{
+ mention
+ follow
+ follow_request
+ reblog
+ favourite
+ move
+ pleroma:emoji_reaction
+ poll
+ }
def index(%{assigns: %{user: user}} = conn, params) do
def index(%{assigns: %{user: user}} = conn, params) do
- params = Map.new(params, fn {k, v} -> {to_string(k), v} end)
+ params =
+ Map.new(params, fn {k, v} -> {to_string(k), v} end)
+ |> Map.put_new("include_types", @default_notification_types)
+
notifications = MastodonAPI.get_notifications(user, params)
conn
notifications = MastodonAPI.get_notifications(user, params)
conn