summaryrefslogtreecommitdiff
path: root/lib/pleroma/web/chat_channel.ex
diff options
context:
space:
mode:
authorMark Felder <feld@FreeBSD.org>2019-12-11 15:02:53 -0600
committerMark Felder <feld@FreeBSD.org>2019-12-11 15:02:53 -0600
commit9ef912aecfbeef670db0614ec2014321c37f3b7a (patch)
tree69eb0b5e11ca321e1ba8ca794171bf0cb425d16d /lib/pleroma/web/chat_channel.ex
parente21afdb7c76c9773aeb51e37ff3bc2874e7a74f7 (diff)
parent92b4a1aa1bc750bb077ae45c422967f9712e247d (diff)
downloadpleroma-9ef912aecfbeef670db0614ec2014321c37f3b7a.tar.gz
pleroma-9ef912aecfbeef670db0614ec2014321c37f3b7a.zip
Merge branch 'develop' into issue/1411
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})