feat(frontend): profile panel about one person with real changes, shared groups, joins and leaves and deleted messages
This commit is contained in:
1 parent
c8d485fe0e
commit
143408cd7f
12 files changed
+899
-244
No files matched your search
@@ -19,7 +19,8 @@ import type {
|
||||
MessageAt,
|
||||
MessageVersion,
|
||||
MessageView,
|
||||
PeerHistoryView,
|
||||
PeerGroups,
|
||||
PeerOverview,
|
||||
PeerView,
|
||||
PinnedView,
|
||||
PolicyChatKind,
|
||||
@@ -30,6 +31,7 @@ import type {
|
||||
PresenceSample,
|
||||
PresenceSession,
|
||||
PresenceStats,
|
||||
ProfileChange,
|
||||
ReactionView,
|
||||
ReadInfo,
|
||||
ResponseStats,
|
||||
@@ -276,8 +278,16 @@ export function getPeer(peerId: number): Promise<PeerView> {
|
||||
return request<PeerView>(`/peers/${peerId}`, { account: true });
|
||||
}
|
||||
|
||||
export function getPeerHistory(peerId: number): Promise<PeerHistoryView[]> {
|
||||
return request<PeerHistoryView[]>(`/peers/${peerId}/history`, {
|
||||
export function getPeerOverview(peerId: number): Promise<PeerOverview> {
|
||||
return request<PeerOverview>(`/peers/${peerId}/overview`, { account: true });
|
||||
}
|
||||
|
||||
export function getPeerGroups(peerId: number): Promise<PeerGroups> {
|
||||
return request<PeerGroups>(`/peers/${peerId}/groups`, { account: true });
|
||||
}
|
||||
|
||||
export function getChatChanges(chatId: number): Promise<ProfileChange[]> {
|
||||
return request<ProfileChange[]>(`/chats/${chatId}/changes`, {
|
||||
account: true,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -451,14 +451,54 @@ export interface ReadInfo {
|
||||
voice: boolean;
|
||||
}
|
||||
|
||||
export interface PeerHistoryView {
|
||||
first_name: string | null;
|
||||
is_deleted_account: boolean;
|
||||
last_name: string | null;
|
||||
observed_at: string;
|
||||
phone: string | null;
|
||||
photo_unique_id: string | null;
|
||||
username: string | null;
|
||||
export type ProfileField = "name" | "username" | "phone" | "deleted" | "title";
|
||||
|
||||
export interface ProfileChange {
|
||||
actor_id: number | null;
|
||||
changed_at: string;
|
||||
field: ProfileField;
|
||||
message_id: number | null;
|
||||
new: string | null;
|
||||
old: string | null;
|
||||
}
|
||||
|
||||
export interface MembershipView {
|
||||
actor_id: number | null;
|
||||
actor_name: string | null;
|
||||
chat_id: number;
|
||||
chat_title: string | null;
|
||||
event: "join" | "leave";
|
||||
has_avatar: boolean;
|
||||
message_id: number;
|
||||
ts: string;
|
||||
}
|
||||
|
||||
export interface DirectChatView {
|
||||
chat_id: number;
|
||||
last_date: string | null;
|
||||
message_count: number;
|
||||
}
|
||||
|
||||
export interface PeerOverview {
|
||||
avatars: AvatarHistoryView[];
|
||||
changes: ProfileChange[];
|
||||
dm: DirectChatView | null;
|
||||
memberships: MembershipView[];
|
||||
peer: PeerView | null;
|
||||
}
|
||||
|
||||
export interface SharedGroupView {
|
||||
chat_id: number;
|
||||
has_avatar: boolean;
|
||||
last_date: string;
|
||||
last_message_id: number;
|
||||
message_count: number;
|
||||
title: string | null;
|
||||
}
|
||||
|
||||
export interface PeerGroups {
|
||||
deleted_count: number;
|
||||
groups: SharedGroupView[];
|
||||
}
|
||||
|
||||
export interface StoryView {
|
||||
|
||||
Reference in new issue
Block a user