diff --git a/osinaweb/db.sqlite3 b/osinaweb/db.sqlite3 index 061d8e95..8a76769b 100644 Binary files a/osinaweb/db.sqlite3 and b/osinaweb/db.sqlite3 differ diff --git a/osinaweb/osichat/__pycache__/consumers.cpython-310.pyc b/osinaweb/osichat/__pycache__/consumers.cpython-310.pyc index ac3d547e..fa251b82 100644 Binary files a/osinaweb/osichat/__pycache__/consumers.cpython-310.pyc and b/osinaweb/osichat/__pycache__/consumers.cpython-310.pyc differ diff --git a/osinaweb/osichat/consumers.py b/osinaweb/osichat/consumers.py index 2e9f1d42..951bbc41 100644 --- a/osinaweb/osichat/consumers.py +++ b/osinaweb/osichat/consumers.py @@ -145,7 +145,7 @@ class Osichat(WebsocketConsumer): chat_rooms_data.append(room_data) self.send(text_data=json.dumps({ - 'event_type': 'get_chats', + 'event_type': 'get_dms', 'chat_rooms_data': chat_rooms_data, }, cls=DjangoJSONEncoder)) else: @@ -193,7 +193,7 @@ class Osichat(WebsocketConsumer): chat_rooms = ChatRoom.objects.annotate(last_update=Max('chatmessage__date_sent'),order_key=Case( When(last_update__isnull=True, then=F('date_created')), default=F('last_update'), - output_field=DateTimeField(),)).filter(chatroomguest__isnull=True, chatmember__member=self.scope["user"]).order_by('-order_key') + output_field=DateTimeField(),)).filter(chatroomguest__isnull=True, chatmember__member=self.scope["user"], chatmessage__isnull=False).order_by('-order_key') else: chat_rooms = None context = {