feat(frontend): my message menu shows when it was read or listened, group readers open in a right panel

This commit is contained in:
hh committed 2026-10-19 02:40:49 +00:00
1 parent f03d7c2890
commit bb38e23f29
14 files changed
+543 -10

No files matched your search

+20
View File
@@ -31,6 +31,7 @@ import type {
PresenceHourly,
PresenceSample,
ReactionView,
ReadInfo,
ResponseStats,
ScopeTarget,
SearchHit,
@@ -304,6 +305,25 @@ export function getChatLinks(
});
}
export function getReadInfo(
chatId: number,
messageId: number
): Promise<ReadInfo> {
return request<ReadInfo>(`/messages/${chatId}/${messageId}/read`, {
account: true,
});
}
export function refreshReadInfo(
chatId: number,
messageId: number
): Promise<{ job_id: number | null }> {
return request<{ job_id: number | null }>(
`/messages/${chatId}/${messageId}/read/refresh`,
{ body: { account_id: accounts.selectedId }, method: "POST" }
);
}
export function getMessageReactions(
chatId: number,
messageId: number
+36
View File
@@ -204,6 +204,7 @@ export interface MessageView {
quote: string | null;
reactions: ReactionCount[];
read: boolean;
read_at: string | null;
reply: ReplyView | null;
sender_id: number | null;
service: ServiceView | null;
@@ -369,6 +370,40 @@ export interface PeerView {
username: string | null;
}
export interface ReaderView {
peer: PeerView | null;
peer_id: number;
read_at: string;
}
export type ReadOutcome =
| "ok"
| "not_read_yet"
| "user_privacy"
| "your_privacy"
| "chat_too_big"
| "too_old"
| "unavailable"
| "flood"
| "error";
export interface ReadInfo {
can_fetch: boolean;
chat_id: number;
chat_kind: "dm" | "group" | "channel";
exact_at: string | null;
fetched_at: string | null;
listened_at: string | null;
message_id: number;
observed_at: string | null;
outcome: ReadOutcome | null;
own: boolean;
read: boolean;
readers: ReaderView[];
unread: boolean;
voice: boolean;
}
export interface PeerHistoryView {
first_name: string | null;
is_deleted_account: boolean;
@@ -518,6 +553,7 @@ export interface LivePresenceEvent {
export interface LiveReceiptEvent {
chat_id: number;
read_at: string;
read_up_to: number;
type: "receipt";
}