projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'feature/delete-follow-requests-on-user-deletion' into 'develop'
[akkoma]
/
lib
/
pleroma
/
web
/
mastodon_api
/
views
/
filter_view.ex
diff --git
a/lib/pleroma/web/mastodon_api/views/filter_view.ex
b/lib/pleroma/web/mastodon_api/views/filter_view.ex
index 3f8c62f242222f43c42015f505d99470c8c58533..aeff646f559d6268d97d700d5163ace67e881c22 100644
(file)
--- a/
lib/pleroma/web/mastodon_api/views/filter_view.ex
+++ b/
lib/pleroma/web/mastodon_api/views/filter_view.ex
@@
-1,18
+1,29
@@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
defmodule Pleroma.Web.MastodonAPI.FilterView do
use Pleroma.Web, :view
defmodule Pleroma.Web.MastodonAPI.FilterView do
use Pleroma.Web, :view
- alias Pleroma.Web.MastodonAPI.FilterView
alias Pleroma.Web.CommonAPI.Utils
alias Pleroma.Web.CommonAPI.Utils
+ alias Pleroma.Web.MastodonAPI.FilterView
- def render("
filters.json", %{filters: filters} = opts
) do
- render_many(filters, FilterView, "
filter.json", opts
)
+ def render("
index.json", %{filters: filters}
) do
+ render_many(filters, FilterView, "
show.json"
)
end
end
- def render("filter.json", %{filter: filter}) do
+ def render("show.json", %{filter: filter}) do
+ expires_at =
+ if filter.expires_at do
+ Utils.to_masto_date(filter.expires_at)
+ else
+ nil
+ end
+
%{
id: to_string(filter.filter_id),
phrase: filter.phrase,
context: filter.context,
%{
id: to_string(filter.filter_id),
phrase: filter.phrase,
context: filter.context,
- expires_at:
Utils.to_masto_date(filter.expires_at)
,
+ expires_at:
expires_at
,
irreversible: filter.hide,
whole_word: false
}
irreversible: filter.hide,
whole_word: false
}