Fixed phone formatting generally.

This commit is contained in:
23rd 2024-02-22 15:17:59 +03:00 committed by John Preston
parent 93d1a187ca
commit afdd22d154
2 changed files with 4 additions and 2 deletions

View file

@ -97,7 +97,7 @@ Contact::Contact(
_phoneLine.setText(
st::webPageDescriptionStyle,
Ui::FormatPhone(QString(phone).replace(QChar('+'), QString())),
Ui::FormatPhone(phone),
Ui::WebpageTextTitleOptions());
#if 0 // No info.

View file

@ -388,7 +388,9 @@ QString FormatPhone(const QString &phone) {
if (phone.at(0) == '0') {
return phone;
}
return Countries::Instance().format({ .phone = phone }).formatted;
return Countries::Instance().format({
.phone = (phone.at(0) == '+') ? phone.mid(1) : phone,
}).formatted;
}
QString FormatTTL(float64 ttl) {