Added support for exclude_types, limit, and min_id in Mastodon
notifications. Unify Mastodon-compatible pagination logic.
This commit is contained in:
parent
1344e34ed3
commit
1588688a11
6 changed files with 204 additions and 58 deletions
|
|
@ -22,6 +22,10 @@ defmodule Pleroma.Activity do
|
|||
"Like" => "favourite"
|
||||
}
|
||||
|
||||
@mastodon_to_ap_notification_types for {k, v} <- @mastodon_notification_types,
|
||||
into: %{},
|
||||
do: {v, k}
|
||||
|
||||
schema "activities" do
|
||||
field(:data, :map)
|
||||
field(:local, :boolean, default: true)
|
||||
|
|
@ -126,6 +130,10 @@ defmodule Pleroma.Activity do
|
|||
|
||||
def mastodon_notification_type(%Activity{}), do: nil
|
||||
|
||||
def from_mastodon_notification_type(type) do
|
||||
Map.get(@mastodon_to_ap_notification_types, type)
|
||||
end
|
||||
|
||||
def all_by_actor_and_id(actor, status_ids \\ [])
|
||||
def all_by_actor_and_id(_actor, []), do: []
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue