agro6162 / talkmyphone

Automatically exported from code.google.com/p/talkmyphone
0 stars 0 forks source link

Wrong regexp "cellPhonePattern" #31

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. open chat window
2. try to send a sms to a number like: 06601234567
3. send the message

What is the expected output? What do you see instead?
talkmyphone should recognise that you want to send a sms to a number, not a 
contact. but, as the cellPhonePattern regexp does not match, is says: No match 
for "06601234567"

What version of the product are you using? On what operating system?
2.0.1 - on android 2.2

Please provide any additional information below.
the current cellPhonePattern is "0[67]\d{8}", which assumes that a mobile 
number is 10 digits long. at least in austria numbers has 11 digits, or even 
more. the correct regexp would be "0[67]\d{8,}", which says that a number has 
to have 10 digits or more.

Original issue reported on code.google.com by andr...@st0cker.at on 18 Sep 2010 at 2:04

GoogleCodeExporter commented 9 years ago
Thank you, this will be corrected ASAP.

Original comment by chm.duquesne on 18 Sep 2010 at 2:48

GoogleCodeExporter commented 9 years ago

Original comment by chm.duquesne on 19 Sep 2010 at 1:33

GoogleCodeExporter commented 9 years ago
Are you sure that in Austria, cellphone numbers start by 06 and 07 as in France 
?
I will fix the regexp pattern for now, but in future release we'll manage 
localization with pattern for different countries.

To be merge in main branche

Original comment by Florent....@gmail.com on 19 Sep 2010 at 10:28

GoogleCodeExporter commented 9 years ago
in austria all mobile numbers start with 06. but, as far as i know, it is also 
possible to send sms to conventional phones, where the prefixes go from 01 to 
07, and numbers have a different length too (but that is not widely used 
anyway).

Original comment by andr...@st0cker.at on 19 Sep 2010 at 10:55

GoogleCodeExporter commented 9 years ago
forgotten to say: prefix 08 are free numbers and 09 are premium rate numbers. 
as you may want to send sms to such numbers too, and i think each country has 
such wide range of different numbers, the easiest way would be to check for any 
number, and assume it is a valid phone number.

Original comment by andr...@st0cker.at on 19 Sep 2010 at 11:03

GoogleCodeExporter commented 9 years ago
I think assume it's a valid number is very dangerous.
I prefer focus on send sms to a known contact !
In future I think that will put the regexp into application parameters with 
predefined patterns. Or add an user command confirmation, if we suppress the 
pattern validation.

Original comment by Florent....@gmail.com on 19 Sep 2010 at 4:02

GoogleCodeExporter commented 9 years ago
I am not a big fan of this solution. I've descibed what I wish for in issue 32. 
I'd say the method for determining a number is a cellphone number should be 
this one:

- Any raw number should be considered correct if entered directly (It's up to 
the user to choose who he/she wants to text too, we should not take the choice 
for them).
- If we look in one contact's phone numbers looking for his/her mobile phone 
number, uset the following algorithm:
- look at all the contact's phone numbers.
  - If he/she has phone numbers tagged mobile
    - If there is only one match, send to this one. 
    - If there is more than one, ask to choose.
  - Otherwise, look if there are other numbers.
    - If there is only one match, send to this one (and warn the user). 
    - Otherwise, fall back to asking the user to choose.

Original comment by chm.duquesne on 19 Sep 2010 at 6:20