mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Add autoupdating for templates (support).
This commit is contained in:
@@ -36,6 +36,16 @@ constexpr auto kMaxGroupChannelTitle = 255; // See also edit_peer_info_box.
|
||||
constexpr auto kMaxChannelDescription = 255; // See also edit_peer_info_box.
|
||||
constexpr auto kMinUsernameLength = 5;
|
||||
|
||||
bool IsValidPhone(QString phone) {
|
||||
phone = phone.replace(QRegularExpression(qsl("[^\\d]")), QString());
|
||||
return (phone.length() >= 8)
|
||||
|| (phone == qsl("333"))
|
||||
|| (phone.startsWith(qsl("42"))
|
||||
&& (phone.length() == 2
|
||||
|| phone.length() == 5
|
||||
|| phone == qsl("4242")));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
style::InputField CreateBioFieldStyle() {
|
||||
@@ -208,7 +218,7 @@ void AddContactBox::save() {
|
||||
_first->showError();
|
||||
}
|
||||
return;
|
||||
} else if (!_user && !App::isValidPhone(phone)) {
|
||||
} else if (!_user && !IsValidPhone(phone)) {
|
||||
_phone->setFocus();
|
||||
_phone->showError();
|
||||
return;
|
||||
|
Reference in New Issue
Block a user