logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git

subscription_view.ex (577B)


  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Web.MastodonAPI.SubscriptionView do
  5. use Pleroma.Web, :view
  6. alias Pleroma.Web.Push
  7. def render("show.json", %{subscription: subscription}) do
  8. %{
  9. id: to_string(subscription.id),
  10. endpoint: subscription.endpoint,
  11. alerts: Map.get(subscription.data, "alerts"),
  12. server_key: server_key()
  13. }
  14. end
  15. defp server_key, do: Keyword.get(Push.vapid_config(), :public_key)
  16. end