[Pkg-mozext-commits] [gcontactsync] 04/17: Issue #49 - New anniversaries in TB are not synchronized to Google

David Prévot taffit at moszumanska.debian.org
Sat Nov 1 23:37:02 UTC 2014


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

taffit pushed a commit to branch master
in repository gcontactsync.

commit 2b73f5473ddf6f31435f679d41dd2856ebc412f6
Author: Josh Geenen <joshgeenen at gmail.com>
Date:   Mon Sep 1 16:37:02 2014 -0500

    Issue #49 - New anniversaries in TB are not synchronized to Google
---
 src/content/GContact.js | 6 +++---
 src/content/gdata.js    | 6 ++++++
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/content/GContact.js b/src/content/GContact.js
index 3b1cb8d..b4d76b4 100644
--- a/src/content/GContact.js
+++ b/src/content/GContact.js
@@ -192,7 +192,7 @@ com.gContactSync.GContact.prototype = {
           return null;
         case com.gContactSync.gdata.contacts.types.EVENT:
           if (arr[i].childNodes[0]) {
-            return new com.gContactSync.Property(arr[i].childNodes[0].getAttribute("startTime"));
+            return new com.gContactSync.Property(arr[i].childNodes[0].getAttribute("startTime"), arr[i].getAttribute("rel"));
           }
           return null;
         default:
@@ -483,12 +483,12 @@ com.gContactSync.GContact.prototype = {
           if (!eventElem) {
             eventElem = document.createElementNS(com.gContactSync.gdata.namespaces.GCONTACT.url, "event");
             eventElem.setAttribute("rel", aType);
-            parentElem.appendChild(document.createElementNS(com.gContactSync.gdata.namespaces.GD.url, "when"));
+            eventElem.appendChild(document.createElementNS(com.gContactSync.gdata.namespaces.GD.url, "when"));
+            this.xml.appendChild(eventElem);
           }
           // TODO - support xs:dateTime
           // TODO - support endTime attribute
           eventElem.firstChild.setAttribute("startTime", aValue);
-          if (!this.mCurrentElement) { this.xml.appendChild(eventElem.parentNode); }
           break;
         default:
           com.gContactSync.LOGGER.LOG_WARNING("Invalid aType parameter sent to the setElementValue"
diff --git a/src/content/gdata.js b/src/content/gdata.js
index 0792e83..d087262 100644
--- a/src/content/gdata.js
+++ b/src/content/gdata.js
@@ -270,6 +270,9 @@ com.gContactSync.gdata = {
         case "website":
           arr = this.WEBSITE_TYPES;
           break;
+        case "event":
+          arr = this.EVENT_TYPES;
+          break;
         default:
           throw "Unrecognized tagName '" + aElement.tagName + "' in setRelOrLabel";
       }
@@ -324,6 +327,9 @@ com.gContactSync.gdata = {
     POSTAL_ADDRESS_TYPES: [
       "home", "work", "other"
     ],
+    EVENT_TYPES: [
+      "other", "anniversary"
+    ],
     /** Tags that are valid an an organization tag */
     ORG_TAGS: {
       orgDepartment:     "1",

-- 
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