aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/mastodon_api/controllers
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2019-09-18 18:13:21 +0300
committerAriadne Conill <ariadne@dereferenced.org>2019-10-06 14:53:11 +0000
commiteae9a6d34d88698ba19ba2461374cb60b1c4a33f (patch)
treee22d426a941c3602d79a78f367aa821dbbb09b29 /lib/pleroma/web/mastodon_api/controllers
parent294e08cb65940ff193d6920e576f56718a5623f4 (diff)
downloadpleroma-eae9a6d34d88698ba19ba2461374cb60b1c4a33f.tar.gz
Initial poll refresh support
Implement refreshing the object with an interval and call the function when getting the poll.
Diffstat (limited to 'lib/pleroma/web/mastodon_api/controllers')
-rw-r--r--lib/pleroma/web/mastodon_api/controllers/mastodon_api_controller.ex2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pleroma/web/mastodon_api/controllers/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/controllers/mastodon_api_controller.ex
index 93ca44d31..edc5e7214 100644
--- a/lib/pleroma/web/mastodon_api/controllers/mastodon_api_controller.ex
+++ b/lib/pleroma/web/mastodon_api/controllers/mastodon_api_controller.ex
@@ -485,7 +485,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
end
def get_poll(%{assigns: %{user: user}} = conn, %{"id" => id}) do
- with %Object{} = object <- Object.get_by_id(id),
+ with %Object{} = object <- Object.get_by_id_and_maybe_refetch(id, interval: 60),
%Activity{} = activity <- Activity.get_create_by_object_ap_id(object.data["id"]),
true <- Visibility.visible_for_user?(activity, user) do
conn