2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-05 00:46:08 +00:00

Error handling changed, 'auto' keyword used for MTP types.

All errors that lead to MTP request resending by default
error handler now can be handled differently. For example
inline bot requests are not being resent on 5XX error codes.
+ extensive use of auto keyword in MTP types handling.
This commit is contained in:
John Preston
2016-04-08 14:44:35 +04:00
parent 35d5089f48
commit 8e89486fbc
41 changed files with 587 additions and 535 deletions

View File

@@ -835,7 +835,7 @@ void AppClass::chatPhotoCleared(PeerId peer, const MTPUpdates &updates) {
void AppClass::selfPhotoDone(const MTPphotos_Photo &result) {
if (!App::self()) return;
const MTPDphotos_photo &photo(result.c_photos_photo());
const auto &photo(result.c_photos_photo());
App::feedPhoto(photo.vphoto);
App::feedUsers(photo.vusers);
cancelPhotoUpdate(App::self()->id);
@@ -851,7 +851,7 @@ void AppClass::chatPhotoDone(PeerId peer, const MTPUpdates &updates) {
}
bool AppClass::peerPhotoFail(PeerId peer, const RPCError &error) {
if (mtpIsFlood(error)) return false;
if (MTP::isDefaultHandledError(error)) return false;
LOG(("Application Error: update photo failed %1: %2").arg(error.type()).arg(error.description()));
cancelPhotoUpdate(peer);