This commit is contained in:
parent
871f7e1d69
commit
c22b560bcf
|
@ -13,7 +13,7 @@ type ChatMember {
|
|||
slug: String!
|
||||
name: String!
|
||||
userpic: String
|
||||
lastSeen: Int!
|
||||
last_seen: Int!
|
||||
online: Boolean
|
||||
# invitedAt: DateTime
|
||||
# invitedBy: String # user slug
|
||||
|
@ -72,18 +72,18 @@ type Message {
|
|||
author: Int!
|
||||
chatId: String!
|
||||
body: String!
|
||||
createdAt: Int!
|
||||
created_at: Int!
|
||||
id: Int!
|
||||
replyTo: Int
|
||||
updatedAt: Int
|
||||
updated_at: Int
|
||||
seen: Boolean
|
||||
}
|
||||
|
||||
type Chat {
|
||||
id: String!
|
||||
createdAt: Int!
|
||||
createdBy: Int!
|
||||
updatedAt: Int!
|
||||
created_at: Int!
|
||||
created_by: Int!
|
||||
updated_at: Int!
|
||||
title: String
|
||||
description: String
|
||||
users: [Int]
|
||||
|
|
|
@ -104,8 +104,8 @@ async def load_messages_by(_, info, by, limit: int = 10, offset: int = 0):
|
|||
messages = await load_messages(by_chat, limit, offset)
|
||||
return {
|
||||
"messages": sorted(
|
||||
[m for m in messages if m.get("createdAt")],
|
||||
key=lambda m: m.get("createdAt"),
|
||||
[m for m in messages if m.get("created_at")],
|
||||
key=lambda m: m.get("created_at"),
|
||||
),
|
||||
"error": None,
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ async def search_in_chats(
|
|||
if days_ago:
|
||||
mmm = list(
|
||||
filter(
|
||||
lambda msg: int(datetime.now(tz=timezone.utc)) - int(msg["createdAt"])
|
||||
lambda msg: int(datetime.now(tz=timezone.utc)) - int(msg["created_at"])
|
||||
< int(timedelta(days=days_ago)),
|
||||
mmm,
|
||||
)
|
||||
|
|
|
@ -9,9 +9,9 @@ class Chat(TypedDict):
|
|||
members: List[int]
|
||||
admins: List[int]
|
||||
title: str
|
||||
updatedAt: Optional[int]
|
||||
createdAt: int
|
||||
createdBy: int
|
||||
updated_at: Optional[int]
|
||||
created_at: int
|
||||
created_by: int
|
||||
description: Optional[str]
|
||||
|
||||
|
||||
|
@ -20,9 +20,9 @@ class ChatPayload(TypedDict):
|
|||
members: List[int | ChatMember]
|
||||
admins: List[int]
|
||||
title: str
|
||||
updatedAt: Optional[int]
|
||||
createdAt: int
|
||||
createdBy: int
|
||||
updated_at: Optional[int]
|
||||
created_at: int
|
||||
created_by: int
|
||||
description: Optional[str]
|
||||
messages: Optional[List[Message]]
|
||||
unread: Optional[List[int]]
|
||||
|
|
|
@ -6,5 +6,5 @@ class ChatMember(TypedDict):
|
|||
slug: str
|
||||
name: str
|
||||
userpic: Optional[str]
|
||||
lastSeen: int
|
||||
last_seen: int
|
||||
online: Optional[bool]
|
||||
|
|
|
@ -6,7 +6,7 @@ class Message(TypedDict):
|
|||
chat: str
|
||||
author: int
|
||||
body: str
|
||||
createdAt: int
|
||||
replyTo: Optional[int]
|
||||
createdAt: int
|
||||
updatedAt: Optional[int]
|
||||
created_at: int
|
||||
reply_to: Optional[int]
|
||||
created_at: int
|
||||
updated_at: Optional[int]
|
||||
|
|
Loading…
Reference in New Issue
Block a user