2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +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

@@ -2079,14 +2079,14 @@ void MediaView::userPhotosLoaded(UserData *u, const MTPphotos_Photos &photos, mt
const QVector<MTPPhoto> *v = 0;
switch (photos.type()) {
case mtpc_photos_photos: {
const MTPDphotos_photos &d(photos.c_photos_photos());
const auto &d(photos.c_photos_photos());
App::feedUsers(d.vusers);
v = &d.vphotos.c_vector().v;
u->photosCount = 0;
} break;
case mtpc_photos_photosSlice: {
const MTPDphotos_photosSlice &d(photos.c_photos_photosSlice());
const auto &d(photos.c_photos_photosSlice());
App::feedUsers(d.vusers);
u->photosCount = d.vcount.v;
v = &d.vphotos.c_vector().v;
@@ -2111,7 +2111,7 @@ void MediaView::deletePhotosDone(const MTPVector<MTPlong> &result) {
}
bool MediaView::deletePhotosFail(const RPCError &error) {
if (mtpIsFlood(error)) return false;
if (MTP::isDefaultHandledError(error)) return false;
return true;
}