feat(frontend): right panel lives in browser history and back closes it first, message panels close on chat switch, hotkeys for search, chats, in-chat search and closing
This commit is contained in:
1 parent
7f7fc1296e
commit
848d2aca1a
19 files changed
+813
-46
No files matched your search
@@ -0,0 +1,32 @@
|
||||
import { request } from "#lib/api/client.js";
|
||||
import type { PresenceSample } from "#lib/api/types.js";
|
||||
|
||||
export interface CaptureStatus {
|
||||
last_seen: string | null;
|
||||
live: boolean;
|
||||
since: string | null;
|
||||
}
|
||||
|
||||
export interface CaptureGap {
|
||||
end: string;
|
||||
start: string;
|
||||
}
|
||||
|
||||
export function getCaptureStatus(accountId: number): Promise<CaptureStatus> {
|
||||
return request<CaptureStatus>("/capture/status", {
|
||||
query: { account_id: accountId },
|
||||
});
|
||||
}
|
||||
|
||||
export function getCaptureGaps(accountId: number): Promise<CaptureGap[]> {
|
||||
return request<CaptureGap[]>("/capture/gaps", {
|
||||
query: { account_id: accountId },
|
||||
});
|
||||
}
|
||||
|
||||
export function getOnline(peerIds: number[]): Promise<PresenceSample[]> {
|
||||
return request<PresenceSample[]>("/presence/online", {
|
||||
account: true,
|
||||
query: { peer_ids: peerIds.join(",") },
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import { request } from "#lib/api/client.js";
|
||||
import type { Annotation } from "#lib/api/types.js";
|
||||
|
||||
export interface Note extends Annotation {
|
||||
chat_has_avatar: boolean;
|
||||
chat_title: string | null;
|
||||
message_date: string | null;
|
||||
message_deleted: boolean;
|
||||
message_has_media: boolean;
|
||||
message_text: string | null;
|
||||
}
|
||||
|
||||
export interface NoteTag {
|
||||
count: number;
|
||||
tag: string;
|
||||
}
|
||||
|
||||
export function listNotes(
|
||||
tag: string | null,
|
||||
offset: number,
|
||||
limit: number
|
||||
): Promise<Note[]> {
|
||||
return request<Note[]>("/annotations/notes", {
|
||||
account: true,
|
||||
query: { limit, offset, tag },
|
||||
});
|
||||
}
|
||||
|
||||
export function listNoteTags(): Promise<NoteTag[]> {
|
||||
return request<NoteTag[]>("/annotations/tags", { account: true });
|
||||
}
|
||||
@@ -45,6 +45,8 @@ export interface Chat {
|
||||
is_contact: boolean;
|
||||
kind: ChatKind;
|
||||
last_date: string | null;
|
||||
last_deleted: boolean;
|
||||
last_message_id: number | null;
|
||||
last_sender_id: number | null;
|
||||
last_text: string | null;
|
||||
message_count: number;
|
||||
@@ -196,6 +198,7 @@ export interface MessageView {
|
||||
entities: EntityView[];
|
||||
forward: ForwardView | null;
|
||||
has_media: boolean;
|
||||
has_note: boolean;
|
||||
inline_buttons: InlineButton[][];
|
||||
is_animated_emoji: boolean;
|
||||
is_self_destruct: boolean;
|
||||
|
||||
Reference in new issue
Block a user