chat v2
This commit is contained in:
SDE
2023-08-11 17:07:43 +03:00
parent 0664a89c4d
commit 067b7db2f0

View File

@@ -105,11 +105,13 @@ def update_chat_ajax(request):
# если есть получатель - получаем сообщения чата
if receiver:
msgs = get_msgs_for_chat_w_users(sender, receiver)
if msgs and msgs.filter(status='sended'):
unreaded_msgs = msgs.filter(status='sended')
if msgs and unreaded_msgs:
context_Dict.update({'messages': msgs})
chat_html = render_to_string(tpl_name, context_Dict, request=request)
res_Dict.update({'chat_html': chat_html})
required_beep = True
unreaded_msgs.update(status='seen')
# if not msgs or (request.user != msgs[0].receiver) or (not msgs and not last_message_modifiedDT) or (msgs and last_message_modifiedDT and msgs[0].modifiedDT <= last_message_modifiedDT):
# Dict.update({