twitter api: add no_rich_text option to userview for account prefs
authorWilliam Pitcock <nenolod@dereferenced.org>
Sat, 22 Sep 2018 03:20:25 +0000 (03:20 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Sat, 22 Sep 2018 03:24:40 +0000 (03:24 +0000)
lib/pleroma/web/twitter_api/views/user_view.ex
test/web/twitter_api/views/user_view_test.exs

index cec9e11a06d1f384e4427d8502fb7e68260b5278..cfbaef4c98527abce67946a7e2d2edff2ed555d6 100644 (file)
@@ -64,7 +64,8 @@ defmodule Pleroma.Web.TwitterAPI.UserView do
       "background_image" => image_url(user.info["background"]) |> MediaProxy.url(),
       "is_local" => user.local,
       "locked" => !!user.info["locked"],
-      "default_scope" => user.info["default_scope"] || "public"
+      "default_scope" => user.info["default_scope"] || "public",
+      "no_rich_text" => user.info["no_rich_text"] || false
     }
 
     if assigns[:token] do
index 7075a237090f1c1dba050c16eac3332ce92d451a..50687f4505808883e41c3fef1e0396893baf66fc 100644 (file)
@@ -87,7 +87,8 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do
       "background_image" => nil,
       "is_local" => true,
       "locked" => false,
-      "default_scope" => "public"
+      "default_scope" => "public",
+      "no_rich_text" => false
     }
 
     assert represented == UserView.render("show.json", %{user: user})
@@ -126,7 +127,8 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do
       "background_image" => nil,
       "is_local" => true,
       "locked" => false,
-      "default_scope" => "public"
+      "default_scope" => "public",
+      "no_rich_text" => false
     }
 
     assert represented == UserView.render("show.json", %{user: user, for: follower})
@@ -166,7 +168,8 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do
       "background_image" => nil,
       "is_local" => true,
       "locked" => false,
-      "default_scope" => "public"
+      "default_scope" => "public",
+      "no_rich_text" => false
     }
 
     assert represented == UserView.render("show.json", %{user: follower, for: user})
@@ -213,7 +216,8 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do
       "background_image" => nil,
       "is_local" => true,
       "locked" => false,
-      "default_scope" => "public"
+      "default_scope" => "public",
+      "no_rich_text" => false
     }
 
     blocker = Repo.get(User, blocker.id)