chat v2
This commit is contained in:
SDE
2023-08-10 20:51:37 +03:00
parent 9344c6fdd4
commit 1a6b176c24
2 changed files with 2 additions and 2 deletions

View File

@@ -34,7 +34,7 @@ class ResponseInterceptionMiddleware:
try:
if type(response) == JsonResponse:
for_save_to_session = request.user.user_profile.get_node_by_name('for_save_to_session')
for_save_to_session = request.user.user_profile.pop_node_by_name('for_save_to_session')
if for_save_to_session:
data = json.loads(response.content)
data.update(for_save_to_session)

View File

@@ -92,7 +92,7 @@ def update_chat_ajax(request):
else:
msgs = get_msgs_for_chat_w_users(sender, receiver)
if (not msgs and not last_message_modifiedDT) or (msgs and last_message_modifiedDT and msgs[0].modifiedDT <= last_message_modifiedDT):
if (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({
'required_beep': False
})