feat(chat): 单向聊天可二次激活 单向聊天可二次激活,未删除方聊天消息保留,双向删除后记录清空
This commit is contained in:
@@ -11,7 +11,7 @@ from sqlalchemy.ext.asyncio import AsyncSession
|
||||
from sqlalchemy.orm import aliased, selectinload
|
||||
|
||||
from core.base.exceptions import WebsocketTooManyRequests
|
||||
from core.db.models import User, Chat, ReadStatus, Message, ChatParticipant
|
||||
from core.db.models import User, Chat, Message, ChatParticipant
|
||||
from core.routers.auth.schema import LoginUser
|
||||
from core.utils.helper import format_date
|
||||
|
||||
@@ -44,7 +44,7 @@ async def get_user_active_direct_chats(
|
||||
async def get_chat_unread_messages_count(db_session: AsyncSession, login_user: LoginUser, chats):
|
||||
"""查询未读消息的预览"""
|
||||
# 查询消息情况
|
||||
read_status_alias = aliased(ReadStatus)
|
||||
read_status_alias = aliased(ChatParticipant)
|
||||
query = (
|
||||
select(Message.chat_id, func.count().label("message_count"))
|
||||
.join(
|
||||
|
||||
Reference in New Issue
Block a user