2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Handle MSG_VOICE_TOO_LONG for voice messages.

This commit is contained in:
John Preston
2022-06-06 18:04:27 +04:00
parent 719190d570
commit f586ea3a75
4 changed files with 11 additions and 3 deletions

View File

@@ -78,12 +78,14 @@ void Transcribes::load(not_null<HistoryItem*> item) {
_session->data().requestItemResize(item);
}
});
}).fail([=] {
}).fail([=](const MTP::Error &error) {
auto &entry = _map[id];
entry.requestId = 0;
entry.pending = false;
entry.failed = true;
if (const auto item = _session->data().message(id)) {
if (error.type() == qstr("MSG_VOICE_TOO_LONG")) {
entry.toolong = true;
} else if (const auto item = _session->data().message(id)) {
_session->data().requestItemResize(item);
}
}).send();

View File

@@ -25,6 +25,7 @@ public:
QString result;
bool shown = false;
bool failed = false;
bool toolong = false;
bool pending = false;
mtpRequestId requestId = 0;
};