Allow posting images without text in mastofe
authorRachel H <lastexyle@gmail.com>
Wed, 6 Jun 2018 06:47:16 +0000 (23:47 -0700)
committerRachel H <lastexyle@gmail.com>
Wed, 6 Jun 2018 18:29:49 +0000 (11:29 -0700)
.gitignore
lib/pleroma/web/mastodon_api/mastodon_api_controller.ex

index 3fbf17ba811a19b805ff714d78a9aee6a26559fb..2ed4c7c8290493bb185865d156989fa61291aea4 100644 (file)
@@ -25,4 +25,7 @@ erl_crash.dump
 /config/setup_db.psql
 
 .DS_Store
-.env
\ No newline at end of file
+.env
+
+# Editor configs
+/.vscode
\ No newline at end of file
index 4252ac2fe2f0bce288bfb181901c2b1086277c6e..974da52032fa161ddbc6dcba154fe2fb69533f67 100644 (file)
@@ -247,7 +247,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
     end
   end
 
-  def dm_timeline(%{assigns: %{user: user}} = conn, params) do
+  def dm_timeline(%{assigns: %{user: user}} = conn, _params) do
     query =
       ActivityPub.fetch_activities_query([user.ap_id], %{"type" => "Create", visibility: "direct"})
 
@@ -300,6 +300,15 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
     end
   end
 
+  def post_status(conn, %{"status" => "", "media_ids" => media_ids} = params)
+      when length(media_ids) > 0 do
+    params =
+      params
+      |> Map.put("status", ".")
+
+    post_status(conn, params)
+  end
+
   def post_status(%{assigns: %{user: user}} = conn, %{"status" => _} = params) do
     params =
       params