Closed 3pt142 closed 6 years ago
Pidgin should display a warning when connection fails because of an invalid phone number, either PHONE_NUMBER_INVALID or "Invalid or non-existing phone number.", did it do that?
Implementing better input validation is probably a good idea, nonetheless.
No, Pidgin did not do that. 3.17.6-1-ARCH, Pidgin 2.10.11 (libpurple 2.10.11)
7~ to 8~, what does that mean?
For example +7 901 555 55 55 to 89015555555
I'm sorry, I'm stumped: So pidgin should change the country code "47" to "48"? Why? I'm curious since the plugin actually won't accept my number as valid/existing even though the official client works just fine with it.
I have russian phone number (+7...), this plugin worked only with 8... one week ago. Now it works only with +7... I'm stumped too :)
@gammy what number format did you enter?
It should only work with the full country code in front of the phone number. +491573123456 for 01573123456 in Germany
instead of +49, the phone number should start with +7 for Russia, don't enter any special characters or spaces at all, it should work.
@workintrust Last Week I've added some input validation for the username input, this might have caused the bug, I'll have to look at it I wasn't aware of that until now.
@majn In my case my country code is +46 (Sweden) although searching the web for similar issues led me here. So, I enter "+46739xxxxxx" (without quotes) where "739" is my mobile number prefix; in-land that'd be "0739", ie exactly as you described in your German example. Presumably any input validation should accept this. Can I perhaps view the post-validation string with some debug flags to pidgin?
Looking at https://github.com/majn/telegram-purple/commit/dbd7d5638b29b515bcf356998ddeac8d7f74a74b I don't see anything that sticks out in particular. The problem might be elsewhere.
I'm going to remove the input validation in the next minor version, there isn't really a point in doing this, I should just pass the input as-is to the telegram server, which then will validate the phone number. You can try the current bugfix branch and see if it works (the input validation is gone there) https://github.com/majn/telegram-purple/commits/bugfixes-0.6.1
@majn I just tried the bugfixes branch and noticed that you've removed the function now. I still get the error message, albeit in the nicer message box.
@gammy Thanks for testing this.
Without the validation, the entered phone number is just read from the settings and put into the libtgl function, so either:
@majn, I'd take a closer look if I had more time!
telegram-cli (git-r754.01f5d9a-1) worked just fine with the telephone number. Running pidgin with the debug flag doesn't reveal anything new:
(13:10:07) prpl-telegram: error for query #6109734461934723072: #400 PHONE_NUMBER_INVALID
(13:10:07) connection: Connection error on 0x2bfab80 (reason: 2 description: Please enter only numbers in the international phone number format, a leading + following by the country prefix and the phone number.
Don't use any whitespaces or any other special characters.)
(13:10:07) account: Disconnecting account XXX (0x24702d0)
(13:10:07) connection: Disconnecting connection 0x2bfab80
(13:10:07) prpl-telegram: tgprpl_close()
It works in telegram-cli, so apparently I'm doing something wrong. This should help me finding the issue, thanks.
Any progress on this? I just gave the plugin another go (on master, 8fec18e8c434e4546ab88e2d3143c59c47d9c169) and it remains the same. If you have more tests for me, I'd be willing to try them out.
The correct numbers for Russia is +79xxxxxx. Format: 89xxxxxx it is an internal format in Russia, not used for international calls/etc (it will fail, of course). WebTelegram at telegram.org allows to enter number only in format (+CountryCode) (PhoneNumber). So it is OK to validate in the same way as Telegram's do.
User @workintrust had entered incorrect number.
This problem persists for me, trying to set up pidgin with israel +972501231231 for 0501231231 but the phone number is still invalid for some reason
It would be nice if Pidgin would correct numbers from 7~ to 8~, otherwise I was confused and could not connect