2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Added handler for MESSAGE_NOT_MODIFIED error when edit media.

This commit is contained in:
23rd
2019-03-29 17:50:49 +03:00
committed by John Preston
parent 653fd1bb63
commit 0e4d85a5e5
4 changed files with 26 additions and 5 deletions

View File

@@ -4640,8 +4640,17 @@ void ApiWrap::editUploadedPhoto(
media,
MTPReplyMarkup(),
sentEntities
)).done([=](const MTPUpdates &result) { LOG(("APPLY.")); applyUpdates(result);
}).fail([=](const RPCError &error) { LOG(("FAIL."));
)).done([=](const MTPUpdates &result) {
item->clearSavedMedia();
applyUpdates(result);
}).fail([=](const RPCError &error) {
QString err = error.type();
if (err == qstr("MESSAGE_NOT_MODIFIED")) {
item->returnSavedMedia();
_session->data().sendHistoryChangeNotifications();
} else {
sendMessageFail(error);
}
}).send();
}
}
@@ -4694,8 +4703,17 @@ void ApiWrap::editUploadedDocument(
media,
MTPReplyMarkup(),
sentEntities
)).done([=](const MTPUpdates &result) { LOG(("APPLY.")); applyUpdates(result);
}).fail([=](const RPCError &error) { LOG(("FAIL."));
)).done([=](const MTPUpdates &result) {
item->clearSavedMedia();
applyUpdates(result);
}).fail([=](const RPCError &error) {
QString err = error.type();
if (err == qstr("MESSAGE_NOT_MODIFIED")) {
item->returnSavedMedia();
_session->data().sendHistoryChangeNotifications();
} else {
sendMessageFail(error);
}
}).send();
}
}