You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
577 B
20 lines
577 B
6 years ago
|
# Pleroma: A lightweight social networking server
|
||
5 years ago
|
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
||
6 years ago
|
# SPDX-License-Identifier: AGPL-3.0-only
|
||
|
|
||
5 years ago
|
defmodule Pleroma.Web.MastodonAPI.SubscriptionView do
|
||
6 years ago
|
use Pleroma.Web, :view
|
||
6 years ago
|
alias Pleroma.Web.Push
|
||
6 years ago
|
|
||
5 years ago
|
def render("show.json", %{subscription: subscription}) do
|
||
6 years ago
|
%{
|
||
|
id: to_string(subscription.id),
|
||
|
endpoint: subscription.endpoint,
|
||
6 years ago
|
alerts: Map.get(subscription.data, "alerts"),
|
||
|
server_key: server_key()
|
||
6 years ago
|
}
|
||
|
end
|
||
6 years ago
|
|
||
6 years ago
|
defp server_key, do: Keyword.get(Push.vapid_config(), :public_key)
|
||
6 years ago
|
end
|