From bf25b9b6031d65569eb87836325793637b1ddec1 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Fri, 28 Dec 2012 15:11:25 +0100 Subject: [PATCH] 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 --- NEWS | 2 ++ folks/phone-details.vala | 11 +++-------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/NEWS b/NEWS index 15f0f766..058f7168 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,8 @@ Bugs fixed: • Bug 689146 — disabling EDS address books does not remove personas • Bug 689859 — core folks does not depend on telepathy • Bug 677633 — Cannot delete favourite +• Bug 685992 — empathy strips the "+" (plus) from the numbers from the + gnome-contacts API changes: • Add Backend.enable_persona_store and disable_persona_store. diff --git a/folks/phone-details.vala b/folks/phone-details.vala index a33cf4a5..fcdd0d96 100644 --- a/folks/phone-details.vala +++ b/folks/phone-details.vala @@ -130,8 +130,8 @@ public class Folks.PhoneFieldDetails : AbstractFieldDetails * Typical normalisations: * * - ``1-800-123-4567`` → ``18001234567`` - * - ``+1-800-123-4567`` → ``18001234567`` - * - ``+1-800-123-4567P123`` → ``18001234567P123`` + * - ``+1-800-123-4567`` → ``+18001234567`` + * - ``+1-800-123-4567P123`` → ``+18001234567P123`` * * @return the normalised form of ``number`` * @@ -145,12 +145,7 @@ public class Folks.PhoneFieldDetails : AbstractFieldDetails { var digit = this.value.slice (i, i + 1); - if (i == 0 && digit == "+") - { - /* we drop the initial + */ - continue; - } - else if (digit in PhoneFieldDetails._extension_chars || + if (digit in PhoneFieldDetails._extension_chars || digit in PhoneFieldDetails._valid_digits) { /* lets keep valid digits */ -- GitLab