Ajaxy / telegram-tt

Telegram Web A, GPL v3
https://web.telegram.org/a
GNU General Public License v3.0
2.21k stars 465 forks source link

Wrong phone number formatting in contact-info #203

Open Synergeia opened 1 year ago

Synergeia commented 1 year ago

When someone sending a contact, formatPhoneNumberWithCode always insert "+" before phone number but it wrong. At least in our country, we have number without "+", instead of "+" numbers can start with "8", for example, "87172123456". Now, before this number wrong formatting adds "+" and you get "+87172123456" - completely wrong number (+8 - Japan or Korea country codes, as far as I know, but this is doesn't matter).

    <div
      className={buildClassName('Contact', isRegistered && 'interactive')}
      onClick={isRegistered ? handleClick : undefined}
    >
      <Avatar size="large" user={user} text={firstName || lastName} animationLevel={animationLevel} withVideo />
      <div className="contact-info">
        <div className="contact-name">{firstName} {lastName}</div>
        <div className="contact-phone">{formatPhoneNumberWithCode(phoneCodeList, phoneNumber)}</div>
      </div>
    </div>

Contact info: изображение

Contact info, when you see it in web telegram: изображение

As you can see, here is an erroneously added "+".

Sorry for bad english.

zubiden commented 1 year ago

Do other Telegram clients display this number correctly?

Synergeia commented 1 year ago

Original client on android displays it correctly. IMG_20221205_091313