Commit d6ab701a authored by kaniini's avatar kaniini

formatting

parent 419d4bd5
...@@ -106,7 +106,8 @@ defmodule Pleroma.Web.OStatus.NoteHandler do ...@@ -106,7 +106,8 @@ defmodule Pleroma.Web.OStatus.NoteHandler do
cw <- OStatus.get_cw(entry), cw <- OStatus.get_cw(entry),
inReplyTo <- XML.string_from_xpath("//thr:in-reply-to[1]/@ref", entry), inReplyTo <- XML.string_from_xpath("//thr:in-reply-to[1]/@ref", entry),
inReplyToActivity <- fetch_replied_to_activity(entry, inReplyTo), inReplyToActivity <- fetch_replied_to_activity(entry, inReplyTo),
inReplyToObject <- (inReplyToActivity && Object.normalize(inReplyToActivity.data["object"])) || nil, inReplyToObject <-
(inReplyToActivity && Object.normalize(inReplyToActivity.data["object"])) || nil,
inReplyTo <- (inReplyToObject && inReplyToObject.data["id"]) || inReplyTo, inReplyTo <- (inReplyToObject && inReplyToObject.data["id"]) || inReplyTo,
attachments <- OStatus.get_attachments(entry), attachments <- OStatus.get_attachments(entry),
context <- get_context(entry, inReplyTo), context <- get_context(entry, inReplyTo),
......
...@@ -52,19 +52,23 @@ defmodule Pleroma.ObjectTest do ...@@ -52,19 +52,23 @@ defmodule Pleroma.ObjectTest do
describe "normalizer" do describe "normalizer" do
test "fetches unknown objects by default" do test "fetches unknown objects by default" do
%Object{} = object = Object.normalize("http://mastodon.example.org/@admin/99541947525187367") %Object{} =
object = Object.normalize("http://mastodon.example.org/@admin/99541947525187367")
assert object.data["url"] == "http://mastodon.example.org/@admin/99541947525187367" assert object.data["url"] == "http://mastodon.example.org/@admin/99541947525187367"
end end
test "fetches unknown objects when fetch_remote is explicitly true" do test "fetches unknown objects when fetch_remote is explicitly true" do
%Object{} = object = Object.normalize("http://mastodon.example.org/@admin/99541947525187367", true) %Object{} =
object = Object.normalize("http://mastodon.example.org/@admin/99541947525187367", true)
assert object.data["url"] == "http://mastodon.example.org/@admin/99541947525187367" assert object.data["url"] == "http://mastodon.example.org/@admin/99541947525187367"
end end
test "does not fetch unknown objects when fetch_remote is false" do test "does not fetch unknown objects when fetch_remote is false" do
assert is_nil(Object.normalize("http://mastodon.example.org/@admin/99541947525187367", false)) assert is_nil(
Object.normalize("http://mastodon.example.org/@admin/99541947525187367", false)
)
end end
end end
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment