Closed
Bug 815833
Opened 12 years ago
Closed 12 years ago
[contacts] Add PhoneNumberJS to ContactsDB
Categories
(Core :: DOM: Device Interfaces, defect)
Tracking
()
People
(Reporter: gwagner, Assigned: gwagner)
References
Details
Attachments
(1 file, 2 obsolete files)
16.24 KB,
patch
|
bent.mozilla
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•12 years ago
|
||
Add the international number to the search field for contacts.
An API search with the international number finds now a contact that was entered with the local number.
We add the international number to the search field for telephone numbers of the contact.
Assignee | ||
Comment 2•12 years ago
|
||
Andrea, can you test this?
Please pull your contacts DB from the phone before you test this patch. Just in case the upgrade code is buggy and I have to rerun the upgrade code with your DB.
It's in data/local/indexedDB/chrome.
Assignee | ||
Updated•12 years ago
|
blocking-basecamp: --- → ?
Assignee | ||
Comment 3•12 years ago
|
||
Attachment #685860 -
Attachment is obsolete: true
Attachment #685867 -
Flags: review?(bent.mozilla)
Comment 4•12 years ago
|
||
[:gwagner] Only one comment in your patch. Take care because there are phone numbers that could be not internationalized! For example, in Spain we have the following number of Movistar: 2236. If you go to the library and you ask for the 'parsed' version of it, you are gonna retrieve null! So in this case instead of the following line:
dump("Warning: No international number found for " + number + "\n");
You should add the request with the phone number that you receive directly, something as:
contact.search[field].push(number.toString());
For create a generic way of doing it (in SMS App we kept a DB with the same problems as this one, and we fix it! ;) ), method 'parse: function(aNumber)' should return or the 'internationalNumber' (if it's available), or 'aNumber' directly, in order to work properly with phone numbers with a length less than 8 characters (http://en.wikipedia.org/wiki/E.164). Thanks!!!
Updated•12 years ago
|
blocking-basecamp: ? → +
Comment on attachment 685867 [details] [diff] [review]
patch
Review of attachment 685867 [details] [diff] [review]:
-----------------------------------------------------------------
r=me with one comment:
::: dom/contacts/fallback/ContactDB.jsm
@@ +171,5 @@
> + debug("InternationalFormat: " + parsedNumber.internationalFormat);
> + debug("InternationalNumber: " + parsedNumber.internationalNumber);
> + debug("NationalNumber: " + parsedNumber.nationalNumber);
> + debug("NationalFormat: " + parsedNumber.nationalFormat);
> + cursor.value.search.tel.push(parsedNumber.internationalNumber);
This could be avoided if parsed number == existing number.
Attachment #685867 -
Flags: review?(bent.mozilla) → review+
Assignee | ||
Comment 6•12 years ago
|
||
upgrade code....
Attachment #685867 -
Attachment is obsolete: true
Attachment #686798 -
Flags: review?(bent.mozilla)
Updated•12 years ago
|
Attachment #686798 -
Flags: review?(bent.mozilla) → review+
Assignee | ||
Comment 7•12 years ago
|
||
Assignee | ||
Comment 8•12 years ago
|
||
Comment 9•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/71ffd1a30c08
https://hg.mozilla.org/mozilla-central/rev/9f1365db9a35
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Comment 10•12 years ago
|
||
Comment 11•12 years ago
|
||
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 13•12 years ago
|
||
Copy & Paste the scenario:
- Store one Contact with 612123123
- Request to Contact API with the internationalized one:
var options = {
filterBy: ['tel'],
filterOp: 'equals',
filterValue: '+34612123123'
};
- Call to API:
window.navigator.mozContacts.find(options);
EXPECTED: Retrieve the contact
CURRENTLY: No contact retrieved for the internationalized version of the phone number
Updated•12 years ago
|
Flags: needinfo?(anygregor)
Assignee | ||
Comment 14•12 years ago
|
||
(In reply to Borja Salguero [:borjasalguero] from comment #13)
> Copy & Paste the scenario:
>
> - Store one Contact with 612123123
> - Request to Contact API with the internationalized one:
> var options = {
> filterBy: ['tel'],
> filterOp: 'equals',
Equals currently only checks the number you entered. 'contains' should work.
Flags: needinfo?(anygregor)
Comment 15•12 years ago
|
||
Thanks! Closing again ;)
Status: REOPENED → RESOLVED
Closed: 12 years ago → 12 years ago
Resolution: --- → FIXED
Updated•12 years ago
|
status-b2g18:
--- → fixed
Blocks: b2g-phonenumberjs
You need to log in
before you can comment on or make changes to this bug.
Description
•