Open decenv opened 13 years ago
I stripped area codes for consistency, but I suppose taking the longest number we ever see for a contact isn't unreasonable.
what do you mean taking the longest number? I am referring to in the left pane list of numbers that have been texted. The ones that have a contact associated show the contact name (this is great), and the ones that don't have contacts (craigslist people that I texted like once and didn't add a contact for) only have the 7 digit number, not the 10 digit number with area code. I don't mean numbers sent as an actual SMS message.
OR was I misunderstanding you somehow?
Right, right. Right now we get numbers as they stand, and sometimes they're 10 digit, and sometimes they're 7 digit, and sometimes they're prefixed by a +, so we just strip all the non-digit characters and then everything down to the last 7 digits and use that (so a conflict could occur if you had two people with the same 7 digits in different area codes). Simplest fix is to keep around the longest number we see that reduces to each give 7 digit suffix and display that longest number in the UI. This doesn't fix potential conflicts, but gives you longer addresses. Fixing conflicts requires playing with address book more, and is Peter's job :-D
OK good, I thought you were talking about numbers sent as texts, and was very confused. I understand it all now.
Come on Peter, school is for squares, work on code! (don't do that, school is very important, don't end up like me)
If you need to do any phone number manipulation, including seeing if two numbers in different formats actually point to the same telephone number, don't forget the libphonenumber library of functions at http://code.google.com/p/libphonenumber/
It now has number validation and number formatting for 228+ countries. This Java library has been ported to a number of languages including official C++ and javascript builds and unofficial C# and Python builds. Various people are working on Ruby, PHP and others.
See title. Probably an outgrowth of starting to ignore the area code, which was a good thing when you had to type the number into the shell, but now serves no purpose.