aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2019-11-09 13:32:11 +0000
committerrinpatch <rinpatch@sdf.org>2019-11-09 13:32:11 +0000
commit182aee9fe865dde5d7271deaa3245f651918d57e (patch)
tree34e5a2a065d78ad0a3dbad2bddacd2dad579ae92 /lib
parent21716aa594064d5f4f4a91a8b40a679775709e1d (diff)
parent287d92c9202de151c917550a5bfc5715d57dff83 (diff)
downloadpleroma-182aee9fe865dde5d7271deaa3245f651918d57e.tar.gz
Merge branch 'release/1.1.5' into 'stable'
Release/1.1.5 See merge request pleroma/pleroma!1954
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/object/containment.ex6
-rw-r--r--lib/pleroma/object/fetcher.ex3
-rw-r--r--lib/pleroma/plugs/trailing_format_plug.ex3
3 files changed, 7 insertions, 5 deletions
diff --git a/lib/pleroma/object/containment.ex b/lib/pleroma/object/containment.ex
index f077a9f32..5f9d75231 100644
--- a/lib/pleroma/object/containment.ex
+++ b/lib/pleroma/object/containment.ex
@@ -51,9 +51,7 @@ defmodule Pleroma.Object.Containment do
def contain_origin(id, %{"attributedTo" => actor} = params),
do: contain_origin(id, Map.put(params, "actor", actor))
- def contain_origin_from_id(_id, %{"id" => nil}), do: :error
-
- def contain_origin_from_id(id, %{"id" => other_id} = _params) do
+ def contain_origin_from_id(id, %{"id" => other_id} = _params) when is_binary(other_id) do
id_uri = URI.parse(id)
other_uri = URI.parse(other_id)
@@ -64,6 +62,8 @@ defmodule Pleroma.Object.Containment do
end
end
+ def contain_origin_from_id(_id, _data), do: :error
+
def contain_child(%{"object" => %{"id" => id, "attributedTo" => _} = object}),
do: contain_origin(id, object)
diff --git a/lib/pleroma/object/fetcher.ex b/lib/pleroma/object/fetcher.ex
index cea33b5af..76f79f45d 100644
--- a/lib/pleroma/object/fetcher.ex
+++ b/lib/pleroma/object/fetcher.ex
@@ -38,7 +38,8 @@ defmodule Pleroma.Object.Fetcher do
data <- maybe_reinject_internal_fields(data, struct),
changeset <- Object.change(struct, %{data: data}),
changeset <- touch_changeset(changeset),
- {:ok, object} <- Repo.insert_or_update(changeset) do
+ {:ok, object} <- Repo.insert_or_update(changeset),
+ {:ok, object} <- Object.set_cache(object) do
{:ok, object}
else
e ->
diff --git a/lib/pleroma/plugs/trailing_format_plug.ex b/lib/pleroma/plugs/trailing_format_plug.ex
index ce366b218..a4b8a406d 100644
--- a/lib/pleroma/plugs/trailing_format_plug.ex
+++ b/lib/pleroma/plugs/trailing_format_plug.ex
@@ -24,7 +24,8 @@ defmodule Pleroma.Plugs.TrailingFormatPlug do
"/api/help",
"/api/externalprofile",
"/notice",
- "/api/pleroma/emoji"
+ "/api/pleroma/emoji",
+ "/api/oauth_tokens"
]
def init(opts) do