Implement live last message update

This commit is contained in:
2025-10-17 15:52:12 +03:00
Unverified
parent dd946e7466
commit a92f91d791
14 changed files with 518 additions and 258 deletions
+7 -1
View File
@@ -170,7 +170,13 @@ export async function deleteDmEnvelope(id: number, recipientId: number, authToke
});
}
export async function fetchDMConversations(token: string): Promise<any[]> {
export interface DMConversationResponse {
user: User;
lastMessage: DmEnvelope;
unreadCount: number;
}
export async function fetchDMConversations(token: string): Promise<DMConversationResponse[]> {
const res = await fetch(`${API_BASE_URL}/dm/conversations`, {
headers: getAuthHeaders(token, true)
});
+3
View File
@@ -305,11 +305,14 @@ export interface Attachment {
// Utils
export interface DMEditPayload {
id: number;
senderId: number;
recipientId: number;
iv: string;
ciphertext: string;
iv2: string;
wrappedMk: string;
salt: string;
timestamp: string;
}
// Requests