summaryrefslogtreecommitdiff
path: root/lib/pleroma/web/chat_channel.ex
diff options
context:
space:
mode:
authorMaxim Filippov <colixer@gmail.com>2019-12-12 02:16:23 +0300
committerMaxim Filippov <colixer@gmail.com>2019-12-12 02:16:23 +0300
commit3ecf131511afc1fc366be6402ca94cf0e6c30e11 (patch)
tree0e8a59c43ccc344bb7d57c32826675aa706b7e8e /lib/pleroma/web/chat_channel.ex
parentcc36a8ea906bd22884101632c6d62c9572e846e1 (diff)
parentfd697cf2090b61db60a02694c3227850df176e2d (diff)
downloadpleroma-3ecf131511afc1fc366be6402ca94cf0e6c30e11.tar.gz
pleroma-3ecf131511afc1fc366be6402ca94cf0e6c30e11.zip
Merge branch 'develop' into feature/report-notes
Diffstat (limited to 'lib/pleroma/web/chat_channel.ex')
-rw-r--r--lib/pleroma/web/chat_channel.ex2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pleroma/web/chat_channel.ex b/lib/pleroma/web/chat_channel.ex
index 08841a3e8..840414933 100644
--- a/lib/pleroma/web/chat_channel.ex
+++ b/lib/pleroma/web/chat_channel.ex
@@ -20,7 +20,7 @@ defmodule Pleroma.Web.ChatChannel do
def handle_in("new_msg", %{"text" => text}, %{assigns: %{user_name: user_name}} = socket) do
text = String.trim(text)
- if String.length(text) > 0 do
+ if String.length(text) in 1..Pleroma.Config.get([:instance, :chat_limit]) do
author = User.get_cached_by_nickname(user_name)
author = Pleroma.Web.MastodonAPI.AccountView.render("show.json", user: author)
message = ChatChannelState.add_message(%{text: text, author: author})