feat(chat): удаление сообщений (у себя/у всех)

This commit is contained in:
klockky
2026-06-12 08:02:31 +00:00
parent 7cc3ae57aa
commit 4ee84745bf
3 changed files with 246 additions and 13 deletions
+22
View File
@@ -467,6 +467,28 @@ class MessagesModule {
return '';
}
Future<bool> deleteMessages(
int chatId,
List<String> messageIds, {
bool forEveryone = false,
}) async {
final ids = messageIds
.map((id) => int.tryParse(id))
.whereType<int>()
.toList();
if (ids.isEmpty) return false;
final payload = {
'messageIds': ids,
'chatId': chatId,
'forMe': !forEveryone,
'itemType': 'REGULAR',
};
final response = await _api.sendRequest(Opcode.msgDelete, payload);
return response.isOk;
}
Future<TranscriptionResult> requestTranscription(
int chatId,
int messageId,