[folks] phone-details: get_normalised: keep the leading '+'



commit bf25b9b6031d65569eb87836325793637b1ddec1
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Fri Dec 28 15:11:25 2012 +0100

    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 15f0f76..058f716 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 a33cf4a..fcdd0d9 100644
--- a/folks/phone-details.vala
+++ b/folks/phone-details.vala
@@ -130,8 +130,8 @@ public class Folks.PhoneFieldDetails : AbstractFieldDetails<string>
    * 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<string>
         {
           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 */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]