Add direct_conversation_id to web push payload
This commit is contained in:
parent
dc9090810d
commit
80ededc04f
3 changed files with 20 additions and 9 deletions
|
|
@ -33,6 +33,8 @@ defmodule Pleroma.Web.Push.Impl do
|
|||
gcm_api_key = Application.get_env(:web_push_encryption, :gcm_api_key)
|
||||
avatar_url = User.avatar_url(actor)
|
||||
object = Object.normalize(activity)
|
||||
user = User.get_cached_by_id(user_id)
|
||||
direct_conversation_id = Activity.direct_conversation_id(activity, user)
|
||||
|
||||
for subscription <- fetch_subsriptions(user_id),
|
||||
get_in(subscription.data, ["alerts", type]) do
|
||||
|
|
@ -45,7 +47,9 @@ defmodule Pleroma.Web.Push.Impl do
|
|||
icon: avatar_url,
|
||||
preferred_locale: "en",
|
||||
pleroma: %{
|
||||
activity_id: activity_id
|
||||
activity_id: activity_id,
|
||||
direct_conversation_id: direct_conversation_id,
|
||||
account: user.ap_id
|
||||
}
|
||||
}
|
||||
|> Jason.encode!()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue