diff --git a/Telegram/SourceFiles/boxes/add_contact_box.cpp b/Telegram/SourceFiles/boxes/add_contact_box.cpp index af6b465e7..da10ff6bc 100644 --- a/Telegram/SourceFiles/boxes/add_contact_box.cpp +++ b/Telegram/SourceFiles/boxes/add_contact_box.cpp @@ -46,7 +46,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL namespace { -constexpr auto kMaxGroupChannelTitle = 255; // See also edit_peer_info_box. +constexpr auto kMaxGroupChannelTitle = 128; // See also edit_peer_info_box. +constexpr auto kMaxUserFirstLastName = 64; // See also edit_contact_box. constexpr auto kMaxChannelDescription = 255; // See also edit_peer_info_box. constexpr auto kMinUsernameLength = 5; @@ -1176,8 +1177,8 @@ void EditNameBox::prepare() { if (_invertOrder) { setTabOrder(_last, _first); } - _first->setMaxLength(kMaxGroupChannelTitle); - _last->setMaxLength(kMaxGroupChannelTitle); + _first->setMaxLength(kMaxUserFirstLastName); + _last->setMaxLength(kMaxUserFirstLastName); connect(_first, &Ui::InputField::submitted, [=] { submit(); }); connect(_last, &Ui::InputField::submitted, [=] { submit(); }); diff --git a/Telegram/SourceFiles/boxes/peers/edit_contact_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_contact_box.cpp index 62258b82e..000ea386a 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_contact_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_contact_box.cpp @@ -25,6 +25,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL namespace { +constexpr auto kMaxUserFirstLastName = 64; // See also add_contact_box. + QString UserPhone(not_null user) { const auto phone = user->phone(); return phone.isEmpty() @@ -220,6 +222,8 @@ void Controller::initNameFields( }; QObject::connect(first, &Ui::InputField::submitted, submit); QObject::connect(last, &Ui::InputField::submitted, submit); + first->setMaxLength(kMaxUserFirstLastName); + first->setMaxLength(kMaxUserFirstLastName); } void Controller::setupWarning() { diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp index 445f631b2..ec4696ad1 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_info_box.cpp @@ -235,7 +235,7 @@ void ShowEditPermissions(not_null peer) { namespace { -constexpr auto kMaxGroupChannelTitle = 255; // See also add_contact_box. +constexpr auto kMaxGroupChannelTitle = 128; // See also add_contact_box. constexpr auto kMaxChannelDescription = 255; // See also add_contact_box. class Controller