feat(chat): add presence metadata and improve web chat core
Some checks failed
CI / test (push) Failing after 22s
Some checks failed
CI / test (push) Failing after 22s
- add user last_seen_at with alembic migration and persist on realtime disconnect - extend chat serialization with private online/last_seen, group members/online, channel subscribers - add Redis batch presence lookup helper - update web chat list/header to display status counters and last-seen labels - improve delivery receipt handling using last_delivered/last_read boundaries - include chat info panel and related API/type updates
This commit is contained in:
@@ -13,6 +13,14 @@ export interface Chat {
|
||||
is_saved?: boolean;
|
||||
unread_count?: number;
|
||||
pinned_message_id?: number | null;
|
||||
members_count?: number | null;
|
||||
online_count?: number | null;
|
||||
subscribers_count?: number | null;
|
||||
counterpart_user_id?: number | null;
|
||||
counterpart_name?: string | null;
|
||||
counterpart_username?: string | null;
|
||||
counterpart_is_online?: boolean | null;
|
||||
counterpart_last_seen_at?: string | null;
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
@@ -20,6 +28,19 @@ export interface DiscoverChat extends Chat {
|
||||
is_member: boolean;
|
||||
}
|
||||
|
||||
export type ChatMemberRole = "owner" | "admin" | "member";
|
||||
|
||||
export interface ChatMember {
|
||||
id: number;
|
||||
user_id: number;
|
||||
role: ChatMemberRole;
|
||||
joined_at: string;
|
||||
}
|
||||
|
||||
export interface ChatDetail extends Chat {
|
||||
members: ChatMember[];
|
||||
}
|
||||
|
||||
export interface Message {
|
||||
id: number;
|
||||
chat_id: number;
|
||||
|
||||
Reference in New Issue
Block a user