squash! Expose expires_at datetime in mastoAPI only for the activity actor
NOTE: rewrite the commit msg
This commit is contained in:
parent
91d9fdc7de
commit
2981821db8
4 changed files with 10 additions and 6 deletions
|
|
@ -168,11 +168,15 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
|
|||
|
||||
client_posted_this_activity = opts[:for] && user.id == opts[:for].id
|
||||
|
||||
expires_at =
|
||||
expires_in =
|
||||
with true <- client_posted_this_activity,
|
||||
expiration when not is_nil(expiration) <-
|
||||
ActivityExpiration.get_by_activity_id(activity.id) do
|
||||
expiration.scheduled_at
|
||||
expires_in_seconds =
|
||||
expiration.scheduled_at
|
||||
|> NaiveDateTime.diff(NaiveDateTime.utc_now(), :second)
|
||||
|
||||
round(expires_in_seconds / 60)
|
||||
end
|
||||
|
||||
thread_muted? =
|
||||
|
|
@ -273,7 +277,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
|
|||
in_reply_to_account_acct: reply_to_user && reply_to_user.nickname,
|
||||
content: %{"text/plain" => content_plaintext},
|
||||
spoiler_text: %{"text/plain" => summary_plaintext},
|
||||
expires_at: expires_at
|
||||
expires_in: expires_in
|
||||
}
|
||||
}
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue