Pleroma.Web.PleromaAPI.ChatController: Dialyzer errors
lib/pleroma/web/pleroma_api/controllers/chat_controller.ex:91:pattern_match The pattern can never match the type. Pattern: {:reject, _message} Type: nil ________________________________________________________________________________ lib/pleroma/web/pleroma_api/controllers/chat_controller.ex:96:pattern_match The pattern can never match the type. Pattern: {:error, _message} Type: nil
This commit is contained in:
parent
dc912dc590
commit
456f7cab3e
|
@ -76,7 +76,7 @@ def post_chat_message(
|
||||||
%{id: id}
|
%{id: id}
|
||||||
) do
|
) do
|
||||||
with {:ok, chat} <- Chat.get_by_user_and_id(user, id),
|
with {:ok, chat} <- Chat.get_by_user_and_id(user, id),
|
||||||
%User{} = recipient <- User.get_cached_by_ap_id(chat.recipient),
|
{_, %User{} = recipient} <- {:user, User.get_cached_by_ap_id(chat.recipient)},
|
||||||
{:ok, activity} <-
|
{:ok, activity} <-
|
||||||
CommonAPI.post_chat_message(user, recipient, params[:content],
|
CommonAPI.post_chat_message(user, recipient, params[:content],
|
||||||
media_id: params[:media_id],
|
media_id: params[:media_id],
|
||||||
|
@ -97,6 +97,11 @@ def post_chat_message(
|
||||||
conn
|
conn
|
||||||
|> put_status(:bad_request)
|
|> put_status(:bad_request)
|
||||||
|> json(%{error: message})
|
|> json(%{error: message})
|
||||||
|
|
||||||
|
{:user, nil} ->
|
||||||
|
conn
|
||||||
|
|> put_status(:bad_request)
|
||||||
|
|> json(%{error: "Recipient does not exist"})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue