[Pkg-mozext-commits] [gcontactsync] 13/31: Issue #56: Contacts incorrectly deleted, added, or duplicated when e-mail address capitalization changes

David Prévot taffit at moszumanska.debian.org
Sun Feb 22 21:34:33 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository gcontactsync.

commit cf6e405957cfd89c6234ec567dc23fa97586a51c
Author: Josh Geenen <joshgeenen at gmail.com>
Date:   Sun Nov 2 13:43:30 2014 -0600

    Issue #56: Contacts incorrectly deleted, added, or duplicated when e-mail address capitalization changes
---
 src/content/GContact.js  | 6 +++---
 src/content/TBContact.js | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/content/GContact.js b/src/content/GContact.js
index b4d76b4..c43f794 100644
--- a/src/content/GContact.js
+++ b/src/content/GContact.js
@@ -794,12 +794,12 @@ com.gContactSync.GContact.prototype = {
    * @returns {string} The ID of this contact.
    */
   getID: function GContact_getID(aFull) {
-    var val   = this.getValue("id").value;
+    var val = this.getValue("id").value || "";
+    val = val.toLowerCase();
     if (aFull) {
       return com.gContactSync.fixURL(val); // make sure to change http to https
     }
-    var index = val.lastIndexOf("/");
-    return val.substr(index + 1);
+    return val.substr(val.lastIndexOf("/") + 1);
   },
   /**
    * Sets the photo for this contact.  Note that this may not immediately take
diff --git a/src/content/TBContact.js b/src/content/TBContact.js
index de5c34a..d82d3db 100644
--- a/src/content/TBContact.js
+++ b/src/content/TBContact.js
@@ -114,8 +114,8 @@ com.gContactSync.TBContact.prototype = {
    * @returns {string} The GoogleID of this contact using https
    */
   getID: function TBContact_getID() {
-    // get the GoogleID then force http: -> https:
-    return com.gContactSync.fixURL(this.getValue("GoogleID"));
+    var id = this.getValue("GoogleID") || "";
+    return com.gContactSync.fixURL(id.toLowerCase());
   },
   /**
    * Sets the value of the requested attribute of this contact and optionally

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/gcontactsync.git



More information about the Pkg-mozext-commits mailing list