From 3378d47189492fbbc6d503126a50fb44ef49511e Mon Sep 17 00:00:00 2001 From: KhadijaAbdeLouassaa Date: Sun, 22 Sep 2024 21:31:26 +0100 Subject: [PATCH] fix js --- src/chats/consumer.py | 12 +- src/db.sqlite3 | Bin 139264 -> 139264 bytes src/templates/chats/index.html | 845 +++++++++++++++++---------------- 3 files changed, 430 insertions(+), 427 deletions(-) diff --git a/src/chats/consumer.py b/src/chats/consumer.py index f324b74..9c0d461 100644 --- a/src/chats/consumer.py +++ b/src/chats/consumer.py @@ -4,16 +4,16 @@ class ChatConsumer(AsyncWebsocketConsumer): async def connect(self): - self.roomGroupName = "group_chat" + self.room_group_name = "group_chat" await self.channel_layer.group_add( - self.roomGroupName, + self.room_group_name, self.channel_name, ) await self.accept() async def disconnect(self, close_code): await self.channel_layer.group_discard( - self.roomGroupName, + self.room_group_name, self.channel_name ) @@ -24,8 +24,8 @@ async def receive(self, text_data): time = text_data_json["time"] thumbnail = text_data_json["thumbnail"] await self.channel_layer.group_send( - self.roomGroupName, { - "type" : "sendMessage", + self.room_group_name, { + "type" : "send_message", "message" : message, "username" : username, "time" : time, @@ -33,7 +33,7 @@ async def receive(self, text_data): } ) - async def sendMessage(self, event): + async def send_message(self, event): message = event["message"] username = event["username"] time = event["time"] diff --git a/src/db.sqlite3 b/src/db.sqlite3 index 341c5f4ff18ec757b9cd0a4bdb1324f267486692..b2dcb34599364428589b5e677fca9bf8b62d1708 100644 GIT binary patch delta 590 zcmZ9}JxW7C5Ww-LA_R-rD7^T-grK0sxVy6-Z=xvPK=1@7%qZgbDs8c#V)L>}TM)<) zU)1Ry2*DFScg)4U&-yHR1Hr~U>LzVLFtKmk46FY?N6<)0sgw21Z1>=Dd^fq}MZS|v XGT`F|^X6C>w)D7ao>tA;MwVrNK!=2* delta 590 zcmZ9}KT1R~5C-t4A}ki#D7^Lk6BY$6VltUb<~>F627)KpMm)gU%A$o>PwNpZEG@U# z(nh?3UO=pb1ygDA+8_BcUoz9#U^*K-f94wocMNrCI_DJu$alV%7=o7lp^A)@w^}ZT zJ~1RMPl-9jj^(Ro&a?1#oOKEu$xULY+Fp<)LSmSl;X7{~6(&(Ij;fbwLhUlyNhv{&pVBdDL1TF0W==yJzF; e$(6k2o6$`^YyxE793%#w?-tGdqFGwWvg{XXY=w{j diff --git a/src/templates/chats/index.html b/src/templates/chats/index.html index 7c63516..ff967d6 100644 --- a/src/templates/chats/index.html +++ b/src/templates/chats/index.html @@ -6,448 +6,451 @@ - + - -
-
-
- -
-
-

Chat-App

- -
- - -
-
- -
- -
- + +
+
+
+ +
+
+

Chat-App

+ +
+ +
+ +
+ +
+
+
+ + +
+ +
+
+ + \ No newline at end of file