Pi’s Blog

My blog about Thunderbird and GSoC 2008

Slightly improved Groups support, bug fix, and Reminder

I have slightly improved support for Groups.  Instead of just showing the groups, you can now either remove a contact from groups that it is in (by deleting the groups in the Edit Card Dialog) and add a contact to existing groups by adding a comma, space, and the name of the group to the end of the Groups textbox.

For a simple example, pretend John Doe is in two groups, Group 1 and Group 2 and you want to remove him from Group 1 and add him to the existing group named Group 3.

Go to the edit card dialog and change this: Group 1, Group 2 to Group 1, Group 3

Bug Fix

I found a bug where the card view pane on the bottom would show some extra attributes from the last card viewed (third and fourth email and added screennames) while viewing a mailing list.


And, as a reminder, please check out the test release (which doesn’t have the fixes mentioned above) and let me know what you think.  I have instructions in my previous post.  The deadline for GSoC code changes is August 18, so I’d like to submit code that doesn’t have any major bugs…  I will still continue working on this extension after that date, of course.


August 2, 2008 Posted by | Uncategorized | , , | Leave a comment

Synchronizing Addresses


Thunderbird stores addresses using 6 fields:  2 lines for the address, the city, the state, the zip code, and the country.  Google stores addresses in one field (supports multiple lines).  Since these two differ so greatly, it is difficult to synchronize addresses properly.

Possible Solution(s):

Splitting the address with newline characters in Google

Address Line 1
Address Line 2

Any empty fields in Thunderbird would mean an empty line in Google.  Google’s mapping feature worked perfectly with the method listed above.

Splitting the address with semicolons

Another possibility is using semicolons instead of newlines to split the address.  Google was also able to map an address formatting in this fashion.  Example:
Address Line 1;Address Line 2;City;State;Zip;Country

Separating using newlines seems to be the most readable (to me), but Google only shows up to 4 lines in the address field and makes you scroll to see beyond that.

Any other ideas or thoughts?

June 28, 2008 Posted by | GSOC | , , , | 1 Comment

Extension Update

Name of the extension

I haven’t figured out a name for the extension yet. I initially named it gcontacts, but that name already exists for several programs. gcontactsync is a potential name. Any suggestions are welcome.


While syncing some newly-created cards, I encountered the following error:

org.xml.sax.SAXParseException: The entity name must immediately follow the “&”; in the entity reference.

The cause was an oversight on my part during the conversion from an nsIAbCard to an XML representation of the contact. I had forgotten to replace special characters, such as &, <, >, ‘, and ” with &, <, >, ‘, and “, respectively. I was fortunate to catch this error before it caused any real problems. I also wrote a function to do the opposite when converting from XML to an nsIAbCard.

Code refactoring and reformatting

While browsing through the code, I realized that I had changed many of the functions and their parameter types without changing the name and the contents of some of the global variables had also changed, so I started refactoring the code. I am also reformatting the code.

lastModifiedDate/Address Book Listener

Since I added support for lastModifiedDate, I no longer need the address book listener.

HTTP Request

I didn’t like my previous HTTP Request methods, so made a few slight modifications. I currently have a generic method for sending an XMLHttpRequest with arguments for the type (POST, PUT, GET, DELETE), URL, body, header label(s)/value(s), and arrays of commands, as strings, to be evaluated depending on the response (OK, 0, or offline, and any error) since the XMLHttpRequest used is asynchronous. This flexibility allows me to call the same function for any HTTP Request that the program must send and act on the outcome.

More contacts supported

When a request is sent to Google for contacts, it only sends the first 25 by default. I now use the max-results query parameter to get the first 250 contacts. 250 was arbitrary, but having that many contacts to sync would probably take a long time. There is now a preference for the number of contacts supported by the extension.

Miscellaneous Improvements

I made a few miscellaneous improvements that resulted in a slight performance increase.  More global variables were removed as well.

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

Progress Update

I finally wrote a bug report for a bug in mailnews relating to importing Address Books.  I was trying to figure out how to import an address book through javascript when I crashed Thunderbird.  I later found out that I forgot to set the field map.  More info on the bug can be found in the report – https://bugzilla.mozilla.org/show_bug.cgi?id=437556

Over the last two days I installed Gentoo and compiled my own kernel and all the programs I am using on it.  It is very fast, and I will probably be using it as my main OS instead of Ubuntu.

I did not yet setup NTP, so my clock was about 20 seconds behind, which showed me a new bug in my extension.  It now checks to see if the contact from Google is from the ‘future’ relative to the computer’s clock and avoids making the Thunderbird card from the future, too.  I will probably do more to fix this later.

June 6, 2008 Posted by | Uncategorized | , , | Leave a comment

June 1 – June 2, 2008

I have been busy recently, but I did manage to remove all the custom helper methods from the script that works with Google Contacts and just use one generic method instead.  I also sped up the sync process by removing the need for one of the for loops I had written.  I rewrote the function that updates a Google Contact, but it is still a little rough and will be rewritten again after I figure out the best way to do it.

June 2, 2008 Posted by | Uncategorized | , , | Leave a comment