Commit bf25b9b6 authored by Guillaume Desmottes's avatar Guillaume Desmottes Committed by Philip Withnall

phone-details: get_normalised: keep the leading '+'

It's needed to be able to call phone numbers containing an international
prefix.

https://bugzilla.gnome.org/show_bug.cgi?id=685992
parent 0084852e
...@@ -23,6 +23,8 @@ Bugs fixed: ...@@ -23,6 +23,8 @@ Bugs fixed:
• Bug 689146 — disabling EDS address books does not remove personas • Bug 689146 — disabling EDS address books does not remove personas
• Bug 689859 — core folks does not depend on telepathy • Bug 689859 — core folks does not depend on telepathy
• Bug 677633 — Cannot delete favourite • Bug 677633 — Cannot delete favourite
• Bug 685992 — empathy strips the "+" (plus) from the numbers from the
gnome-contacts
API changes: API changes:
• Add Backend.enable_persona_store and disable_persona_store. • Add Backend.enable_persona_store and disable_persona_store.
......
...@@ -130,8 +130,8 @@ public class Folks.PhoneFieldDetails : AbstractFieldDetails<string> ...@@ -130,8 +130,8 @@ public class Folks.PhoneFieldDetails : AbstractFieldDetails<string>
* Typical normalisations: * Typical normalisations:
* *
* - ``1-800-123-4567`` → ``18001234567`` * - ``1-800-123-4567`` → ``18001234567``
* - ``+1-800-123-4567`` → ``18001234567`` * - ``+1-800-123-4567`` → ``+18001234567``
* - ``+1-800-123-4567P123`` → ``18001234567P123`` * - ``+1-800-123-4567P123`` → ``+18001234567P123``
* *
* @return the normalised form of ``number`` * @return the normalised form of ``number``
* *
...@@ -145,12 +145,7 @@ public class Folks.PhoneFieldDetails : AbstractFieldDetails<string> ...@@ -145,12 +145,7 @@ public class Folks.PhoneFieldDetails : AbstractFieldDetails<string>
{ {
var digit = this.value.slice (i, i + 1); var digit = this.value.slice (i, i + 1);
if (i == 0 && digit == "+") if (digit in PhoneFieldDetails._extension_chars ||
{
/* we drop the initial + */
continue;
}
else if (digit in PhoneFieldDetails._extension_chars ||
digit in PhoneFieldDetails._valid_digits) digit in PhoneFieldDetails._valid_digits)
{ {
/* lets keep valid digits */ /* lets keep valid digits */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment