0.2.19
chat v2
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user