Add char limit to chat

This commit is contained in:
cuom1999 2022-05-12 00:01:47 -05:00
parent b1f91d432c
commit efee4ad081
2 changed files with 3 additions and 1 deletions

View file

@ -120,6 +120,8 @@ def post_message(request):
ret = {'msg': 'posted'}
if request.method != 'POST':
return HttpResponseBadRequest()
if len(request.POST['body']) > 5000:
return HttpResponseBadRequest()
room = None
if request.POST['room']:

View file

@ -614,7 +614,7 @@ let META_HEADER = [
</div>
<div style="height: 15%">
<a id="emoji-button" href="#" title="{{_('Emoji')}}"><i class="icofont-slightly-smile"></i></a>
<textarea id="chat-input" placeholder="{{_('Enter your message')}}"></textarea>
<textarea maxlength="5000" id="chat-input" placeholder="{{_('Enter your message')}}"></textarea>
</div>
<div class="tooltip" role="tooltip">
<emoji-picker></emoji-picker>