diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index 691b3b20b..942d92582 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -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..."; diff --git a/Telegram/SourceFiles/boxes/addcontactbox.cpp b/Telegram/SourceFiles/boxes/addcontactbox.cpp index 5f3457ca7..b3e1c85c7 100644 --- a/Telegram/SourceFiles/boxes/addcontactbox.cpp +++ b/Telegram/SourceFiles/boxes/addcontactbox.cpp @@ -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; } diff --git a/Telegram/SourceFiles/boxes/contactsbox.cpp b/Telegram/SourceFiles/boxes/contactsbox.cpp index 803cd32e0..9c8e49098 100644 --- a/Telegram/SourceFiles/boxes/contactsbox.cpp +++ b/Telegram/SourceFiles/boxes/contactsbox.cpp @@ -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; } diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index f6194d524..a2f4454c8 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -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()) { + _minh += st::msgDateFont->height - st::msgDateDelta.y(); + } } else { _minh = st::msgFilePadding.top() + st::msgFileSize + st::msgFilePadding.bottom(); }