chat v2
This commit is contained in:
SDE
2023-08-09 19:55:10 +03:00
parent 2f089ecaa3
commit 7cfd5ce60b
5 changed files with 140 additions and 58 deletions

View File

@@ -25,17 +25,21 @@ def show_chat_w_user_ajax(request):
try:
data = json.loads(request.body)
Dict = get_chat_page_content_Dict(request, data['user_id'])
from AuthApp.models import User
cur_receiver = User.objects.get(id=data['user_id'])
receivers = get_chat_receivers_for_user(request.user)
Dict = {
'cur_receiver': cur_receiver,
'messages': get_msgs_for_chat_w_users(request.user, cur_receiver),
'receivers': receivers,
}
# from AuthApp.models import User
# cur_receiver = User.objects.get(id=data['user_id'])
#
# receivers = get_chat_receivers_for_user(request.user)
#
# msgs = get_msgs_for_chat_w_users(request.user, cur_receiver)
# msgs.filter(receiver=request.user).update(status='seen')
#
# Dict = {
# 'cur_receiver': cur_receiver,
# 'messages': msgs,
# 'receivers': receivers,
# }
tpl_name = 'blocks/profile/b_chats.html'