feat: add reply/forward/pin message flow across backend and web
Some checks failed
CI / test (push) Failing after 24s
Some checks failed
CI / test (push) Failing after 24s
- add reply_to/forwarded_from message fields and chat pinned_message field - add forward and pin APIs plus reply support in message create - wire web actions: Reply, Fwd, Pin and reply composer state - fix spam policy bug: allow repeated identical messages, keep rate limiting
This commit is contained in:
@@ -51,13 +51,15 @@ export async function sendMessageWithClientId(
|
||||
chatId: number,
|
||||
text: string,
|
||||
type: MessageType,
|
||||
clientMessageId: string
|
||||
clientMessageId: string,
|
||||
replyToMessageId?: number
|
||||
): Promise<Message> {
|
||||
const { data } = await http.post<Message>("/messages", {
|
||||
chat_id: chatId,
|
||||
text,
|
||||
type,
|
||||
client_message_id: clientMessageId
|
||||
client_message_id: clientMessageId,
|
||||
reply_to_message_id: replyToMessageId
|
||||
});
|
||||
return data;
|
||||
}
|
||||
@@ -116,3 +118,17 @@ export async function updateMessageStatus(
|
||||
status
|
||||
});
|
||||
}
|
||||
|
||||
export async function forwardMessage(messageId: number, targetChatId: number): Promise<Message> {
|
||||
const { data } = await http.post<Message>(`/messages/${messageId}/forward`, {
|
||||
target_chat_id: targetChatId
|
||||
});
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function pinMessage(chatId: number, messageId: number | null): Promise<Chat> {
|
||||
const { data } = await http.post<Chat>(`/chats/${chatId}/pin`, {
|
||||
message_id: messageId
|
||||
});
|
||||
return data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user