From c2b69798dd924f287a720ad5a57feed99b14d609 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Sat, 22 Sep 2018 02:17:19 +0000 Subject: [PATCH] twitter api: add support for disabling rich text --- .../web/twitter_api/twitter_api_controller.ex | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/pleroma/web/twitter_api/twitter_api_controller.ex b/lib/pleroma/web/twitter_api/twitter_api_controller.ex index b3a56b27e..cd2bb5b57 100644 --- a/lib/pleroma/web/twitter_api/twitter_api_controller.ex +++ b/lib/pleroma/web/twitter_api/twitter_api_controller.ex @@ -443,6 +443,20 @@ def update_profile(%{assigns: %{user: user}} = conn, params) do user end + user = + if no_rich_text = params["no_rich_text"] do + with no_rich_text <- no_rich_text == "true", + new_info <- Map.put(user.info, "no_rich_text", no_rich_text), + change <- User.info_changeset(user, %{info: new_info}), + {:ok, user} <- User.update_and_set_cache(change) do + user + else + _e -> user + end + else + user + end + user = if default_scope = params["default_scope"] do with new_info <- Map.put(user.info, "default_scope", default_scope),