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
+4 -2
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();