0.3.18
support chat v3
This commit is contained in:
@@ -40,13 +40,13 @@ class ChatConsumer(WebsocketConsumer):
|
||||
sender = data['sender']
|
||||
receiver = data['receiver']
|
||||
|
||||
from .funcs import send_msg, update_chat
|
||||
from .funcs import send_msg, get_update_chat_Dict
|
||||
data.update({
|
||||
'cur_user': sender,
|
||||
'required_beep': False,
|
||||
})
|
||||
send_msg(data)
|
||||
Dict = update_chat(data)
|
||||
Dict = get_update_chat_Dict(data)
|
||||
|
||||
group_name = f'user_{sender}'
|
||||
resDict = {
|
||||
@@ -68,10 +68,15 @@ class ChatConsumer(WebsocketConsumer):
|
||||
'cur_user': receiver,
|
||||
'required_beep': True,
|
||||
})
|
||||
Dict = update_chat(data)
|
||||
Dict = get_update_chat_Dict(data)
|
||||
|
||||
if 'support_chat_html' in Dict:
|
||||
msg_type = 'update_support_chat'
|
||||
else:
|
||||
msg_type = 'update_chat'
|
||||
|
||||
resDict = {
|
||||
'type': 'update_chat',
|
||||
'type': msg_type,
|
||||
'sender': receiver,
|
||||
'receiver': sender,
|
||||
'group_name': group_name,
|
||||
@@ -87,6 +92,11 @@ class ChatConsumer(WebsocketConsumer):
|
||||
|
||||
self.send(text_data=json.dumps(data))
|
||||
|
||||
def update_support_chat(self, data):
|
||||
print(f'ws update_support_chat {data["group_name"]}')
|
||||
|
||||
self.send(text_data=json.dumps(data))
|
||||
|
||||
def update_chat(self, data):
|
||||
print(f'ws update_chat {data["group_name"]}')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user