diff options
author | marcin mikołajczak <git@mkljczk.pl> | 2024-09-12 14:37:37 +0200 |
---|---|---|
committer | marcin mikołajczak <git@mkljczk.pl> | 2024-09-12 14:37:37 +0200 |
commit | 17b69c43d5ed6ba867f5fb1da15f6af9aa7c5d00 (patch) | |
tree | 1b03b19b63a873436da6bfdb0a023aa86f9243eb /lib | |
parent | 360dd34f1925316f51f354e3c5658dafb414b483 (diff) | |
download | pleroma-17b69c43d5ed6ba867f5fb1da15f6af9aa7c5d00.tar.gz pleroma-17b69c43d5ed6ba867f5fb1da15f6af9aa7c5d00.zip |
Add `group_key` to notifications
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/api_spec/operations/notification_operation.ex | 5 | ||||
-rw-r--r-- | lib/pleroma/web/mastodon_api/views/notification_view.ex | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/pleroma/web/api_spec/operations/notification_operation.ex b/lib/pleroma/web/api_spec/operations/notification_operation.ex index 2dc0f66df..94d1f6b82 100644 --- a/lib/pleroma/web/api_spec/operations/notification_operation.ex +++ b/lib/pleroma/web/api_spec/operations/notification_operation.ex @@ -158,6 +158,10 @@ defmodule Pleroma.Web.ApiSpec.NotificationOperation do type: :object, properties: %{ id: %Schema{type: :string}, + group_key: %Schema{ + type: :string, + description: "Group key shared by similar notifications" + }, type: notification_type(), created_at: %Schema{type: :string, format: :"date-time"}, account: %Schema{ @@ -180,6 +184,7 @@ defmodule Pleroma.Web.ApiSpec.NotificationOperation do }, example: %{ "id" => "34975861", + "group-key" => "ungrouped-34975861", "type" => "mention", "created_at" => "2019-11-23T07:49:02.064Z", "account" => Account.schema().example, diff --git a/lib/pleroma/web/mastodon_api/views/notification_view.ex b/lib/pleroma/web/mastodon_api/views/notification_view.ex index 3f2478719..c277af98b 100644 --- a/lib/pleroma/web/mastodon_api/views/notification_view.ex +++ b/lib/pleroma/web/mastodon_api/views/notification_view.ex @@ -95,6 +95,7 @@ defmodule Pleroma.Web.MastodonAPI.NotificationView do response = %{ id: to_string(notification.id), + group_key: "ungrouped-" <> to_string(notification.id), type: notification.type, created_at: CommonAPI.Utils.to_masto_date(notification.inserted_at), account: account, |