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

Moved HistoryWidget::saveEditMsgDone/Fail to lambdas.

This commit is contained in:
23rd
2020-05-30 10:10:54 +03:00
parent c52da743fd
commit b02b690747
4 changed files with 54 additions and 70 deletions

View File

@@ -953,15 +953,9 @@ void EditCaptionBox::save() {
});
const auto fail = crl::guard(this, [=](const RPCError &error) {
const auto defaultErrors = {
u"MESSAGE_ID_INVALID"_q,
u"CHAT_ADMIN_REQUIRED"_q,
u"MESSAGE_EDIT_TIME_EXPIRED"_q,
};
_saveRequestId = 0;
const auto &type = error.type();
if (ranges::contains(defaultErrors, type)) {
if (ranges::contains(Api::kDefaultEditMessagesErrors, type)) {
_error = tr::lng_edit_error(tr::now);
update();
} else if (type == u"MESSAGE_NOT_MODIFIED"_q) {