TwitterAPI: Add is_local to user view.
authoreal <eal@waifu.club>
Thu, 1 Feb 2018 19:41:19 +0000 (21:41 +0200)
committereal <eal@waifu.club>
Thu, 1 Feb 2018 19:41:19 +0000 (21:41 +0200)
lib/pleroma/web/twitter_api/views/user_view.ex
test/web/twitter_api/views/user_view_test.exs

index 1b995f42fea3322a901febd16750214338ef4264..f49bcc0fb1e6fb90e20d17d7d9aa16448f1df870 100644 (file)
@@ -47,6 +47,7 @@ defmodule Pleroma.Web.TwitterAPI.UserView do
       "statusnet_profile_url" => user.ap_id,
       "cover_photo" => User.banner_url(user) |> MediaProxy.url(),
       "background_image" => image_url(user.info["background"]) |> MediaProxy.url(),
+      "is_local" => user.local
     }
 
     if assigns[:token] do
index 3f84e4116959e76c54b9b3f373783917561b2a58..e68230a86c4224ce4f7c2ee55c4de8132e716200 100644 (file)
@@ -56,7 +56,8 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do
       "rights" => %{},
       "statusnet_profile_url" => user.ap_id,
       "cover_photo" => banner,
-      "background_image" => nil
+      "background_image" => nil,
+      "is_local" => true
     }
 
     assert represented == UserView.render("show.json", %{user: user})
@@ -88,7 +89,8 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do
       "rights" => %{},
       "statusnet_profile_url" => user.ap_id,
       "cover_photo" => banner,
-      "background_image" => nil
+      "background_image" => nil,
+      "is_local" => true
     }
 
     assert represented == UserView.render("show.json", %{user: user, for: follower})
@@ -121,7 +123,8 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do
       "rights" => %{},
       "statusnet_profile_url" => follower.ap_id,
       "cover_photo" => banner,
-      "background_image" => nil
+      "background_image" => nil,
+      "is_local" => true
     }
 
     assert represented == UserView.render("show.json", %{user: follower, for: user})
@@ -154,7 +157,8 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do
       "rights" => %{},
       "statusnet_profile_url" => user.ap_id,
       "cover_photo" => banner,
-      "background_image" => nil
+      "background_image" => nil,
+      "is_local" => true
     }
 
     blocker = Repo.get(User, blocker.id)