aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/common_api/common_api.ex
diff options
context:
space:
mode:
authorkaniini <nenolod@gmail.com>2019-04-19 16:55:33 +0000
committerkaniini <nenolod@gmail.com>2019-04-19 16:55:33 +0000
commit9da8b287f8a2c1fda2ca05351d5418321510472b (patch)
treeef85c774a5450fadc30f9ad2e5beaaca11e2bf02 /lib/pleroma/web/common_api/common_api.ex
parentcc93775ebf539598075c0b9afb96c60c8bede6b5 (diff)
parentf9865cf9439e2e9273f55d3b82c1e68166178b07 (diff)
downloadpleroma-9da8b287f8a2c1fda2ca05351d5418321510472b.tar.gz
Merge branch 'feature/database-compaction' into 'develop'
database compaction See merge request pleroma/pleroma!473
Diffstat (limited to 'lib/pleroma/web/common_api/common_api.ex')
-rw-r--r--lib/pleroma/web/common_api/common_api.ex11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/pleroma/web/common_api/common_api.ex b/lib/pleroma/web/common_api/common_api.ex
index 74babdf14..6458a3449 100644
--- a/lib/pleroma/web/common_api/common_api.ex
+++ b/lib/pleroma/web/common_api/common_api.ex
@@ -125,7 +125,10 @@ defmodule Pleroma.Web.CommonAPI do
"public"
in_reply_to ->
- Pleroma.Web.MastodonAPI.StatusView.get_visibility(in_reply_to.data["object"])
+ # XXX: these heuristics should be moved out of MastodonAPI.
+ with %Object{} = object <- Object.normalize(in_reply_to) do
+ Pleroma.Web.MastodonAPI.StatusView.get_visibility(object)
+ end
end
end
@@ -214,8 +217,10 @@ defmodule Pleroma.Web.CommonAPI do
with %Activity{
actor: ^user_ap_id,
data: %{
- "type" => "Create",
- "object" => %{
+ "type" => "Create"
+ },
+ object: %Object{
+ data: %{
"to" => object_to,
"type" => "Note"
}