summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSergey Suprunenko <suprunenko.s@gmail.com>2019-08-04 17:13:06 +0000
committerkaniini <ariadne@dereferenced.org>2019-08-04 17:13:06 +0000
commite8ad116c2a5a166613f9609c8fe2559af2b97505 (patch)
treeb3a5bf521de42a1834bd55e580b18757008a43c8 /lib
parent9e7c633b39bb430f2d6d68656e681218d421e780 (diff)
downloadpleroma-e8ad116c2a5a166613f9609c8fe2559af2b97505.tar.gz
pleroma-e8ad116c2a5a166613f9609c8fe2559af2b97505.zip
Do not add the "next" key to likes.json if there is no more items
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/activity_pub/views/object_view.ex4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/pleroma/web/activity_pub/views/object_view.ex b/lib/pleroma/web/activity_pub/views/object_view.ex
index 6028b773c..94d05f49b 100644
--- a/lib/pleroma/web/activity_pub/views/object_view.ex
+++ b/lib/pleroma/web/activity_pub/views/object_view.ex
@@ -66,8 +66,10 @@ defmodule Pleroma.Web.ActivityPub.ObjectView do
"orderedItems" => items
}
- if offset < total do
+ if offset + length(items) < total do
Map.put(map, "next", "#{iri}?page=#{page + 1}")
+ else
+ map
end
end
end