summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMike Verdone <spiral@arcseconds.net>2019-07-24 17:09:59 +0200
committerMike Verdone <spiral@arcseconds.net>2019-07-24 17:09:59 +0200
commit2c83eb0b157b2f574f55341e9171f0b5ab7bd3b2 (patch)
treec52ea70a7f01e436eedd0065e04e86911accb1f6 /lib
parent877575d0da830724e822eac2de243391aaea7ec8 (diff)
downloadpleroma-2c83eb0b157b2f574f55341e9171f0b5ab7bd3b2.tar.gz
pleroma-2c83eb0b157b2f574f55341e9171f0b5ab7bd3b2.zip
Revert "squash! Expose expires_at datetime in mastoAPI only for the activity actor"
This reverts commit 2981821db834448bf9b2ba26590314e36201664c.
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/mastodon_api/views/status_view.ex10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex
index 4a3686d72..7264dcafb 100644
--- a/lib/pleroma/web/mastodon_api/views/status_view.ex
+++ b/lib/pleroma/web/mastodon_api/views/status_view.ex
@@ -168,15 +168,11 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
client_posted_this_activity = opts[:for] && user.id == opts[:for].id
- expires_in =
+ expires_at =
with true <- client_posted_this_activity,
expiration when not is_nil(expiration) <-
ActivityExpiration.get_by_activity_id(activity.id) do
- expires_in_seconds =
- expiration.scheduled_at
- |> NaiveDateTime.diff(NaiveDateTime.utc_now(), :second)
-
- round(expires_in_seconds / 60)
+ expiration.scheduled_at
end
thread_muted? =
@@ -277,7 +273,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_in: expires_in
+ expires_at: expires_at
}
}
end