Allow posting images without text in mastofe

This commit is contained in:
Rachel H 2018-06-05 23:47:16 -07:00
parent 0a0c6bf394
commit b4292295d7
2 changed files with 14 additions and 2 deletions

5
.gitignore vendored
View File

@ -25,4 +25,7 @@ erl_crash.dump
/config/setup_db.psql /config/setup_db.psql
.DS_Store .DS_Store
.env .env
# Editor configs
/.vscode

View File

@ -247,7 +247,7 @@ def user_statuses(%{assigns: %{user: reading_user}} = conn, params) do
end end
end end
def dm_timeline(%{assigns: %{user: user}} = conn, params) do def dm_timeline(%{assigns: %{user: user}} = conn, _params) do
query = query =
ActivityPub.fetch_activities_query([user.ap_id], %{"type" => "Create", visibility: "direct"}) ActivityPub.fetch_activities_query([user.ap_id], %{"type" => "Create", visibility: "direct"})
@ -300,6 +300,15 @@ def get_context(%{assigns: %{user: user}} = conn, %{"id" => id}) do
end end
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 def post_status(%{assigns: %{user: user}} = conn, %{"status" => _} = params) do
params = params =
params params