Commit ab83e0de authored by eal's avatar eal
Browse files

TwitterAPI: Add is_local to user view.

parent 15cb3f2b
Pipeline #593 passed with stage
in 3 minutes
...@@ -47,6 +47,7 @@ def render("user.json", %{user: user = %User{}} = assigns) do ...@@ -47,6 +47,7 @@ def render("user.json", %{user: user = %User{}} = assigns) do
"statusnet_profile_url" => user.ap_id, "statusnet_profile_url" => user.ap_id,
"cover_photo" => User.banner_url(user) |> MediaProxy.url(), "cover_photo" => User.banner_url(user) |> MediaProxy.url(),
"background_image" => image_url(user.info["background"]) |> MediaProxy.url(), "background_image" => image_url(user.info["background"]) |> MediaProxy.url(),
"is_local" => user.local
} }
if assigns[:token] do if assigns[:token] do
......
...@@ -56,7 +56,8 @@ test "A user" do ...@@ -56,7 +56,8 @@ test "A user" do
"rights" => %{}, "rights" => %{},
"statusnet_profile_url" => user.ap_id, "statusnet_profile_url" => user.ap_id,
"cover_photo" => banner, "cover_photo" => banner,
"background_image" => nil "background_image" => nil,
"is_local" => true
} }
assert represented == UserView.render("show.json", %{user: user}) assert represented == UserView.render("show.json", %{user: user})
...@@ -88,7 +89,8 @@ test "A user for a given other follower", %{user: user} do ...@@ -88,7 +89,8 @@ test "A user for a given other follower", %{user: user} do
"rights" => %{}, "rights" => %{},
"statusnet_profile_url" => user.ap_id, "statusnet_profile_url" => user.ap_id,
"cover_photo" => banner, "cover_photo" => banner,
"background_image" => nil "background_image" => nil,
"is_local" => true
} }
assert represented == UserView.render("show.json", %{user: user, for: follower}) assert represented == UserView.render("show.json", %{user: user, for: follower})
...@@ -121,7 +123,8 @@ test "A user that follows you", %{user: user} do ...@@ -121,7 +123,8 @@ test "A user that follows you", %{user: user} do
"rights" => %{}, "rights" => %{},
"statusnet_profile_url" => follower.ap_id, "statusnet_profile_url" => follower.ap_id,
"cover_photo" => banner, "cover_photo" => banner,
"background_image" => nil "background_image" => nil,
"is_local" => true
} }
assert represented == UserView.render("show.json", %{user: follower, for: user}) assert represented == UserView.render("show.json", %{user: follower, for: user})
...@@ -154,7 +157,8 @@ test "A blocked user for the blocker", %{user: user} do ...@@ -154,7 +157,8 @@ test "A blocked user for the blocker", %{user: user} do
"rights" => %{}, "rights" => %{},
"statusnet_profile_url" => user.ap_id, "statusnet_profile_url" => user.ap_id,
"cover_photo" => banner, "cover_photo" => banner,
"background_image" => nil "background_image" => nil,
"is_local" => true
} }
blocker = Repo.get(User, blocker.id) blocker = Repo.get(User, blocker.id)
......
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