emile 8 months ago
parent 938ecbd32c
commit e3ac745118

@ -285,7 +285,7 @@ class ChatRoomGuest(models.Model):
super().save(*args, **kwargs)
self.send_chat_notification()
def send_chat_notification(self):
type_id = self.id
type_id = self.room.id
session_id = self.visitor.session_id
title = "New chat on Ositcom!"
body = f"Visitor {self.visitor.ip_address} started a new chat on Ositcom"
@ -336,7 +336,7 @@ class ChatMessage(models.Model):
if not self.member:
self.send_message_notification()
def send_message_notification(self):
type_id = self.id
type_id = self.room.id
session_id = self.room.chatroomguest.visitor.session_id
title = f"Visitor {self.room.chatroomguest.visitor.ip_address} sent a new message on Ositcom!"
body = f"{self.content}"

@ -155,7 +155,7 @@ function handleLoadChatEvent(data, osichatSocket) {
scrollBottom();
if (isOpen) { // If chat widget isOpen (declared in chat-toggle.js) mark all messages as read by guest else just return number of unread messages
if (isOpen) { // If chat widget isOpen mark all messages as read by guest else just return number of unread messages
osichatSocket.send(JSON.stringify({ 'event_type': 'update_read_messages', 'chat_state': 'open' }));
} else {
osichatSocket.send(JSON.stringify({ 'event_type': 'update_read_messages', 'chat_state': 'closed' }));

Loading…
Cancel
Save