aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/chat_channel.ex
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2019-12-06 15:36:30 +0000
committerrinpatch <rinpatch@sdf.org>2019-12-06 15:36:30 +0000
commit6cb31edd76fd42a0e33bc365d982cd02e3578d6c (patch)
tree5de31560895d42820fd17341ef47509dc6212e30 /lib/pleroma/web/chat_channel.ex
parenta280be34e36223aefd3d5e26fcddb9faad77310b (diff)
parent24599c519f95f27e1fb8120104f13856d2fa3742 (diff)
downloadpleroma-6cb31edd76fd42a0e33bc365d982cd02e3578d6c.tar.gz
Merge branch 'feature/1455-chat-character-limit' into 'develop'
Feature/1455 chat character limit Closes #1455 See merge request pleroma/pleroma!2034
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})