|
|
@ -580,14 +580,17 @@ class OsitcomChatRoom(WebsocketConsumer):
|
|
|
|
|
|
|
|
|
|
|
|
if self.client_type == 'mobile_admin':
|
|
|
|
if self.client_type == 'mobile_admin':
|
|
|
|
chat_room_data = model_to_dict(chat_room)
|
|
|
|
chat_room_data = model_to_dict(chat_room)
|
|
|
|
chat_room_data['visitor'] = {
|
|
|
|
if hasattr(chat_room, 'chatroomguest'):
|
|
|
|
'id': chat_room.chatroomguest.visitor.id,
|
|
|
|
chat_room_data['visitor'] = {
|
|
|
|
'country_flag': chat_room.chatroomguest.visitor.flag_image_url,
|
|
|
|
'id': chat_room.chatroomguest.visitor.id,
|
|
|
|
'is_online': chat_room.chatroomguest.visitor.is_online,
|
|
|
|
'country_flag': chat_room.chatroomguest.visitor.flag_image_url,
|
|
|
|
'ip': chat_room.chatroomguest.visitor.ip_address,
|
|
|
|
'is_online': chat_room.chatroomguest.visitor.is_online,
|
|
|
|
}
|
|
|
|
'ip': chat_room.chatroomguest.visitor.ip_address,
|
|
|
|
chat_room_messages_data = []
|
|
|
|
}
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
chat_room_data['visitor'] = None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chat_room_messages_data = []
|
|
|
|
for message in chat_room_messages:
|
|
|
|
for message in chat_room_messages:
|
|
|
|
message_data = model_to_dict(message)
|
|
|
|
message_data = model_to_dict(message)
|
|
|
|
attachment = getattr(message, 'chatmessageattachment', None)
|
|
|
|
attachment = getattr(message, 'chatmessageattachment', None)
|
|
|
|