Pi’s Blog

My blog about Thunderbird and GSoC 2008

gContactSync version 0.1.1 released

Version 0.1.1 of gContactSync is out and available for download here.  Right-click and hit Save Link As, then install it in Thunderbird.

New Features:

  • Greatly improved Preferences dialog (thanks to some help from Leszek(teo)Życzkowski)
  • Bug 19960 – Add a preference to enable/disable the toolbar button
  • An icon (again, thanks to some help from Leszek(teo)Życzkowski)
  • Verbose logging is disabled by default (should speed things up slightly)

Bug Fixes:

  • Bug 19964 – Log file window is too small in Thunderbird 3.0b1pre
  • Bug 20099 – gdata.makeAuthBody does not encode the e-mail address or password
  • Bug 19959 – the sync toolbar item got a wrong icon and can’t be removed from toolbar – UPDATE – this may not have been fixed according to the bug reporter.  Please let me know if this still happens.

Basic Features

  • Synchronizes contacts between Google Mail and Mozilla Thunderbird (2 or 3)
  • Can synchronize several accounts with their own address books
  • Adds attributes and “types” for phone numbers and screennames to Thunderbird
  • Customizable with a preferences dialog
  • en-US and es-ES locales

More Information

As always, feedback, feature requests, and bug reports are appreciated, but please be patient as I’ve been extremely busy with college, work, and co-op/internship hunting.  Thanks to everybody who has provided feedback up to this point.

TraceMonkey Note – if you are using Thunderbird 3.0b1pre, you can try enabling TraceMonkey.  It made the synchronization process faster for me.  Great job everbody who worked on it!


October 18, 2008 Posted by | GSOC | , , , , , | 5 Comments

Birthday Field for Thunderbird’s Address Book

While working on my extension and reading discussions in #maildev, I noticed Bug 13595 – Add Birthday Fields to Address Book is still marked as NEW but has a high priority and a lot of votes in Bugzilla.  With the datepicker XUL element now available and some knowledge of the address book from working on my extension, adding a birthday field should be simple, but I have a few questions about how exactly this should appear.  This post isn’t a promise to fix this since school starts very soon and I’m trying to graduate in 3 years (1 year left after this year), but I’d like to at least get things started so somebody else can finish things up, if I am unable to do so myself.

Question #1: Which type of datepicker should be used?

There are three valid types for the datepicker element

  1. Normal – This just shows a small box that lets one type or increment/decrement the date shown with the arrows
  2. Grid – This shows a calendar and lets one click arrows to change the month (and year) and select a day from the calendar.
  3. Popup – It shows the same box as Normal, but also allows one to chose the date from a calendar like Grid does.

Notes: the two gContactSync tabs are from my extension and the Other tab isn’t necessarily going to be used; it just had the most extra room, and not all three types will be present, obviously.

Question #2 Which tab (for now)?

I know that the new/edit card dialogs might change, but which tab is best until then?  Where should it be located in the tab?

Question #3 What if the user doesn’t change the date?  How can a date be removed?

If the user doesn’t change the date, we probably do not want to save the birthday info.  Right now it only saves the date if it was changed, but there is not a way to remove the date for now.

Question #4 Store the BirthMonth as a number from 0-11 (like JavaScript does) or 1-12?

I tested LDIF import/export of the birthday information, but I remembered that JavaScript treats the month as a number from 0-11 and that is how I store the month.  Storing it as an integer from 0-11 is easiest since it is accessed through JavaScript (and shown from 1-12).


I have created an initial patch that uses a popup datepicker in the Other tab that only sets the card’s BirthDay, BirthMonth, and BirthYear if the datepicker has been updated.  It also adds the birthday to the card view in the format generated by Date.toLocaleDate()

I added BirthDay and BirthMonth to the attribute map in mailnews.js so it will export the birthday information (BirthYear is already present).  CSV and tab imports and exports BirthDay, BirthMonth and BirthYear already.

You can see my current WIP here.

August 17, 2008 Posted by | thunderbird | , , | 4 Comments

New Attributes Added to Address Book

I have almost finished adding some new attributes to the address book that can be synced with Google.  The attributes will work on cards whether they are in the address book being synced or not.

The catch: It requires the current patch to Bug 413260, which is temporarily delayed.

The list currently includes:

  • ThirdEmail
  • FourthEmail
  • HomeFaxNumber – Thunderbird’s Fax Number is synced as a work fax number, but Google also has an option for a home fax number.
  • OtherNumber – A phone number marked as “other” in Google
  • OtherAddress – on multiple lines, similar to Google Contacts
  • Google Talk screenname*
  • ICQ screenname*
  • Yahoo! screenname*
  • MSN screenname*
  • Jabber screenname*

*the screennames are listed as text; there is no link to open your IM client(s).

It is easy to add more, so please let me know what you would like added.

I have a (large) screenshot on my website hereI cannot yet save changes made in the edit card dialog, but I expect to have that finished soon.

July 7, 2008 Posted by | GSOC | , , | 2 Comments

Progress Update

L10n (Localization) Support

I finished adding support for localization to the extension.  It previously used l10n for the XUL files, but I just finished localizing strings in the scripts.  If you or somebody you know would like to help translate this extension please let me know.

Contact Conversion Rewrite

I completely re-wrote the methods that convert contacts from Google Contacts to Thunderbird Address Book cards and vice versa and went from nearly 700 lines of code to just under 275 (with comments).  To do so, I defined an object that stores Thunderbird’s name for the property (like DisplayName), and information on how Google stores the contact data in Atom/XML (the namespace, tag name, whether the data is stored in an attribute or in the child node, and more).

As of now, the supported attributes in Thunderbird include:

DisplayName, Notes, PrimaryEmail, SecondEmail, CellularNumber, HomePhone, WorkPhone, PagerNumber, FaxNumber, HomeAddress, WorkAddress, _AimScreenName, Company, and JobTitle

Possible Name

I finally decided on a possible name that some initial searching on Google tells me is unique: gContactSync.  Any feedback on the name is welcome and I’ll gladly change it if I find a better name.


I removed the need for the “shortDelay” preference.

June 26, 2008 Posted by | GSOC | , , , , | Leave a comment