feat(web): improve message UX, voice gestures, and attachments
Some checks failed
CI / test (push) Failing after 21s
Some checks failed
CI / test (push) Failing after 21s
This commit is contained in:
@@ -1,5 +1,17 @@
|
||||
import { http } from "./http";
|
||||
import type { Chat, ChatDetail, ChatInviteLink, ChatMember, ChatMemberRole, ChatType, DiscoverChat, Message, MessageReaction, MessageType } from "../chat/types";
|
||||
import type {
|
||||
Chat,
|
||||
ChatAttachment,
|
||||
ChatDetail,
|
||||
ChatInviteLink,
|
||||
ChatMember,
|
||||
ChatMemberRole,
|
||||
ChatType,
|
||||
DiscoverChat,
|
||||
Message,
|
||||
MessageReaction,
|
||||
MessageType
|
||||
} from "../chat/types";
|
||||
import axios from "axios";
|
||||
|
||||
export interface ChatNotificationSettings {
|
||||
@@ -225,6 +237,16 @@ export async function joinByInvite(token: string): Promise<Chat> {
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function getChatAttachments(chatId: number, limit = 100, beforeId?: number): Promise<ChatAttachment[]> {
|
||||
const { data } = await http.get<ChatAttachment[]>(`/media/chats/${chatId}/attachments`, {
|
||||
params: {
|
||||
limit,
|
||||
before_id: beforeId
|
||||
}
|
||||
});
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function deleteMessage(messageId: number, forAll = false): Promise<void> {
|
||||
await http.delete(`/messages/${messageId}`, { params: { for_all: forAll } });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user