aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2019-02-15 12:27:03 +0000
committerrinpatch <rinpatch@sdf.org>2019-02-15 12:27:03 +0000
commitb63a5e309d7a36c27b745eb74ec8a7115c60a820 (patch)
tree3bcf63fee115fc41db300c8067c9bf15a53d8bb4 /lib
parentea2698beb75074e6c94acf0c66bcdbdb47f59acd (diff)
parent32b164943433ddebfdb04494bbd4d4e8a90578d4 (diff)
downloadpleroma-b63a5e309d7a36c27b745eb74ec8a7115c60a820.tar.gz
Merge branch 'bugfix/actor-containment' into 'develop'
activitypub: correctly handle bare URIs in user lookup Closes #645 See merge request pleroma/pleroma!829
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/user.ex2
-rw-r--r--lib/pleroma/web/activity_pub/activity_pub.ex4
2 files changed, 2 insertions, 4 deletions
diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex
index 3232cb842..29d2b3d89 100644
--- a/lib/pleroma/user.ex
+++ b/lib/pleroma/user.ex
@@ -731,7 +731,7 @@ defmodule Pleroma.User do
# Strip the beginning @ off if there is a query
query = String.trim_leading(query, "@")
- if resolve, do: User.get_or_fetch_by_nickname(query)
+ if resolve, do: get_or_fetch(query)
fts_results = do_search(fts_search_subquery(query), for_user)
diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex
index c46d8233e..ab2872f56 100644
--- a/lib/pleroma/web/activity_pub/activity_pub.ex
+++ b/lib/pleroma/web/activity_pub/activity_pub.ex
@@ -818,8 +818,6 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
if object = Object.get_cached_by_ap_id(id) do
{:ok, object}
else
- Logger.info("Fetching #{id} via AP")
-
with {:ok, data} <- fetch_and_contain_remote_object_from_id(id),
nil <- Object.normalize(data),
params <- %{
@@ -851,7 +849,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
end
def fetch_and_contain_remote_object_from_id(id) do
- Logger.info("Fetching #{id} via AP")
+ Logger.info("Fetching object #{id} via AP")
with true <- String.starts_with?(id, "http"),
{:ok, %{body: body, status: code}} when code in 200..299 <-