projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tests: fix up nodeinfo tests
[akkoma]
/
lib
/
pleroma
/
web
/
activity_pub
/
views
/
object_view.ex
diff --git
a/lib/pleroma/web/activity_pub/views/object_view.ex
b/lib/pleroma/web/activity_pub/views/object_view.ex
index 1930420562b28b470de6fc1dad058a63d83154fa..94d05f49b35177f9822b70e1428f6ec4f6accc89 100644
(file)
--- a/
lib/pleroma/web/activity_pub/views/object_view.ex
+++ b/
lib/pleroma/web/activity_pub/views/object_view.ex
@@
-4,7
+4,8
@@
defmodule Pleroma.Web.ActivityPub.ObjectView do
use Pleroma.Web, :view
defmodule Pleroma.Web.ActivityPub.ObjectView do
use Pleroma.Web, :view
- alias Pleroma.{Object, Activity}
+ alias Pleroma.Activity
+ alias Pleroma.Object
alias Pleroma.Web.ActivityPub.Transmogrifier
def render("object.json", %{object: %Object{} = object}) do
alias Pleroma.Web.ActivityPub.Transmogrifier
def render("object.json", %{object: %Object{} = object}) do
@@
-16,7
+17,7
@@
defmodule Pleroma.Web.ActivityPub.ObjectView do
def render("object.json", %{object: %Activity{data: %{"type" => "Create"}} = activity}) do
base = Pleroma.Web.ActivityPub.Utils.make_json_ld_header()
def render("object.json", %{object: %Activity{data: %{"type" => "Create"}} = activity}) do
base = Pleroma.Web.ActivityPub.Utils.make_json_ld_header()
- object = Object.normalize(activity
.data["object"]
)
+ object = Object.normalize(activity)
additional =
Transmogrifier.prepare_object(activity.data)
additional =
Transmogrifier.prepare_object(activity.data)
@@
-27,7
+28,7
@@
defmodule Pleroma.Web.ActivityPub.ObjectView do
def render("object.json", %{object: %Activity{} = activity}) do
base = Pleroma.Web.ActivityPub.Utils.make_json_ld_header()
def render("object.json", %{object: %Activity{} = activity}) do
base = Pleroma.Web.ActivityPub.Utils.make_json_ld_header()
- object = Object.normalize(activity
.data["object"]
)
+ object = Object.normalize(activity)
additional =
Transmogrifier.prepare_object(activity.data)
additional =
Transmogrifier.prepare_object(activity.data)
@@
-46,7
+47,7
@@
defmodule Pleroma.Web.ActivityPub.ObjectView do
"id" => "#{ap_id}/likes",
"type" => "OrderedCollection",
"totalItems" => length(likes),
"id" => "#{ap_id}/likes",
"type" => "OrderedCollection",
"totalItems" => length(likes),
- "first" => collection(likes, "#{ap_id}/
follower
s", 1)
+ "first" => collection(likes, "#{ap_id}/
like
s", 1)
}
|> Map.merge(Pleroma.Web.ActivityPub.Utils.make_json_ld_header())
end
}
|> Map.merge(Pleroma.Web.ActivityPub.Utils.make_json_ld_header())
end
@@
-65,8
+66,10
@@
defmodule Pleroma.Web.ActivityPub.ObjectView do
"orderedItems" => items
}
"orderedItems" => items
}
- if offset < total do
+ if offset
+ length(items)
< total do
Map.put(map, "next", "#{iri}?page=#{page + 1}")
Map.put(map, "next", "#{iri}?page=#{page + 1}")
+ else
+ map
end
end
end
end
end
end