projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '1559-follow-request-notifications' into 'develop'
[akkoma]
/
lib
/
pleroma
/
web
/
mastodon_api
/
views
/
scheduled_activity_view.ex
diff --git
a/lib/pleroma/web/mastodon_api/views/scheduled_activity_view.ex
b/lib/pleroma/web/mastodon_api/views/scheduled_activity_view.ex
index 1ebff7aba5ff46d112812c68d0d79637c246c30d..458f6bc78636de7ece1bf98c94459631feec6b90 100644
(file)
--- a/
lib/pleroma/web/mastodon_api/views/scheduled_activity_view.ex
+++ b/
lib/pleroma/web/mastodon_api/views/scheduled_activity_view.ex
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-20
19
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-20
20
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.MastodonAPI.ScheduledActivityView do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.MastodonAPI.ScheduledActivityView do
@@
-7,17
+7,16
@@
defmodule Pleroma.Web.MastodonAPI.ScheduledActivityView do
alias Pleroma.ScheduledActivity
alias Pleroma.Web.CommonAPI
alias Pleroma.ScheduledActivity
alias Pleroma.Web.CommonAPI
- alias Pleroma.Web.MastodonAPI.ScheduledActivityView
alias Pleroma.Web.MastodonAPI.StatusView
def render("index.json", %{scheduled_activities: scheduled_activities}) do
alias Pleroma.Web.MastodonAPI.StatusView
def render("index.json", %{scheduled_activities: scheduled_activities}) do
- render_many(scheduled_activities,
ScheduledActivityView
, "show.json")
+ render_many(scheduled_activities,
__MODULE__
, "show.json")
end
def render("show.json", %{scheduled_activity: %ScheduledActivity{} = scheduled_activity}) do
%{
end
def render("show.json", %{scheduled_activity: %ScheduledActivity{} = scheduled_activity}) do
%{
- id:
scheduled_activity.id |> to_string
,
- scheduled_at:
scheduled_activity.scheduled_at |> CommonAPI.Utils.to_masto_date(
),
+ id:
to_string(scheduled_activity.id)
,
+ scheduled_at:
CommonAPI.Utils.to_masto_date(scheduled_activity.scheduled_at
),
params: status_params(scheduled_activity.params)
}
|> with_media_attachments(scheduled_activity)
params: status_params(scheduled_activity.params)
}
|> with_media_attachments(scheduled_activity)
@@
-41,13
+40,9
@@
defmodule Pleroma.Web.MastodonAPI.ScheduledActivityView do
in_reply_to_id: params["in_reply_to_id"]
}
in_reply_to_id: params["in_reply_to_id"]
}
- data =
- if media_ids = params["media_ids"] do
- Map.put(data, :media_ids, media_ids)
- else
- data
- end
-
- data
+ case params["media_ids"] do
+ nil -> data
+ media_ids -> Map.put(data, :media_ids, media_ids)
+ end
end
end
end
end