bubble enlarged for signed thumbed files, error string display added for group/channel create error

This commit is contained in:
John Preston 2016-03-24 18:31:11 +03:00
parent 605f5305e4
commit 978e86a8ba
4 changed files with 19 additions and 1 deletions

View File

@ -686,6 +686,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
"lng_cant_invite_banned" = "Sorry, only admin can add this user.";
"lng_cant_invite_privacy" = "Sorry, you cannot add this user to groups because of the privacy settings.";
"lng_cant_invite_privacy_channel" = "Sorry, you cannot add this user to channels because of the privacy settings.";
"lng_cant_do_this" = "Sorry, this action is unavailable.";
"lng_send_button" = "Send";
"lng_message_ph" = "Write a message...";

View File

@ -540,6 +540,9 @@ bool GroupInfoBox::creationFail(const RPCError &error) {
_title.setFocus();
_title.showError();
return true;
} else if (error.type() == qstr("USER_RESTRICTED")) {
Ui::showLayer(new InformBox(lang(lng_cant_do_this)));
return true;
}
return false;
}

View File

@ -284,6 +284,8 @@ bool ContactsInner::addAdminFail(const RPCError &error, mtpRequestId req) {
Ui::showLayer(new MaxInviteBox(_channel->invitationUrl), KeepOtherLayers);
} else if (error.type() == "ADMINS_TOO_MUCH") {
Ui::showLayer(new InformBox(lang(lng_channel_admins_too_much)), KeepOtherLayers);
} else if (error.type() == qstr("USER_RESTRICTED")) {
Ui::showLayer(new InformBox(lang(lng_cant_do_this)), KeepOtherLayers);
} else {
emit adminAdded();
}
@ -1718,7 +1720,13 @@ bool ContactsBox::editAdminFail(const RPCError &error) {
if (mtpIsFlood(error)) return true;
--_saveRequestId;
_inner.chat()->invalidateParticipants();
if (!_saveRequestId) onClose();
if (!_saveRequestId) {
if (error.type() == qstr("USER_RESTRICTED")) {
Ui::showLayer(new InformBox(lang(lng_cant_do_this)));
return true;
}
onClose();
}
return false;
}
@ -1765,6 +1773,9 @@ bool ContactsBox::creationFail(const RPCError &error) {
} else if (error.type() == "PEER_FLOOD") {
Ui::showLayer(new InformBox(lng_cant_invite_not_contact(lt_more_info, textcmdLink(qsl("https://telegram.org/faq?_hash=can-39t-send-messages-to-non-contacts"), lang(lng_cant_more_info)))), KeepOtherLayers);
return true;
} else if (error.type() == qstr("USER_RESTRICTED")) {
Ui::showLayer(new InformBox(lang(lng_cant_do_this)));
return true;
}
return false;
}

View File

@ -3902,6 +3902,9 @@ void HistoryDocument::initDimensions(const HistoryItem *parent) {
if (thumbed) {
_minh = st::msgFileThumbPadding.top() + st::msgFileThumbSize + st::msgFileThumbPadding.bottom();
if (!captioned && parent->Is<HistoryMessageSigned>()) {
_minh += st::msgDateFont->height - st::msgDateDelta.y();
}
} else {
_minh = st::msgFilePadding.top() + st::msgFileSize + st::msgFilePadding.bottom();
}