ssh-contact has a new home

Thanks to admin, Tollef Fog Heen, SSH-Contact now has a bugzilla (product=”Telepathy” and Component=”ssh-contact”) on The new place for release tarballs is here.

Debian unstable and Ubuntu maverick already has it packaged, Ubuntu lucid users can get it from our telepathy ppa. I don’t know for other distributions, but if you are packager and love ssh-contact, please push it to your favourite distro :D

Various plugins for your N900 addressbook

Marco Barisione and myself worked on some plugins to extend the N900’s Contacts application. I grouped them in the fremantle-contacts project on gitorious. You can find on the project wiki page a short description of what we have already. Here is an overview:

Contacts Merger

Plugin to find probable duplicate contacts and allow the user to easily merge them.

Available in extra-devel maemo repository, package name: “contacts-merger”

Extended Contacts Search

Plugin to extend the live search feature on addressbook’s main view. It will also search in contacts phone numbers, nickname, emails and IM usernames.

Available in extra-devel maemo repository, package name: “extended-contacts-search”

Contact Zoom

Plugin to add a Contact Zoom menu option it Contact starter view. The Contact Zoom opens a window with all information about that contact displayed in bigger font, to make it much more readable.

Available in extra-devel maemo repository, package name: “contact-zoom”

Telepathy-ssh renamed to ssh-contact and released

I’m glad to announce the first release of ssh-contact, previously known as telepathy-ssh but renamed because there is already so many telepathy-foo projects (mainly ConnectionManagers) that it could be confusing.

It now has a great interactive CLI, letting you select which IM contact to connect. Of course it display only the contacts who installed the ssh-contact service.

Distro packagers, you can find the ssh-contact 0.1 tarball here. I’ll probably host the project on in the future.

Feedback would be appreciated!

SSH your IM contacts

Did you ever wanted to connect to your computer but couldn’t make an SSH connection because it is behind a NAT, dynamic IP or firewall? Telepathy-ssh is for you!

Telepathy-ssh is a simple client/service program that make an ssh connection through a telepathy Tube.

$ telepathy-ssh-client gabble/jabber/testman2_40jabber_2ebelnet_2ebe1
xclaesse@’s password:
Linux xclaesse-laptop 2.6.32-23-generic #37-Ubuntu SMP Fri Jun 11 08:03:28 UTC 2010 x86_64 GNU/Linux
Ubuntu 10.04 LTS

Welcome to Ubuntu!
* Documentation:

Last login: Mon Jul 12 17:55:39 2010 from xclaesse-laptop
xclaesse@xclaesse-laptop:~$ exit
Connection to closed.

Of course I’m planning to make the CLI a bit better. At least I would like to let choose the account between a list instead of having to type its ID manually. You can know your accountID using “mc-tool list” command. Also since the telepathy tube creates a local socket on which the ssh client connects, you see that it says it’s connecting to “”, is it possible to tell ssh client to display another hostname?

I wrote that tool to make easy to connect my mother’s computer remotely, whithout dealing with her dynamic IP and NAT. If you also find that tool useful, and have suggestions, feel free to post a comment, or even patches :)

Need help with non-latin alphabet

Felix Kaser is working for Collabora, writing EmpathyLiveSearch widget. It is a widget similar to N900’s HildonLiveSearch. The goal is to make easy to search in your contact list in a smart way. So it match only if words are starting with your search string. For example if you have a contact “Xavier Claessens”, typing “Xav” or “Cla” will show it, but not if you enter “ier” nor “ssens”. The match is of course case-insensitive, so typing “xav” will match as well.

Where things gets more complicated, is that our code also try to strip accentuation marks. For example if you have a contact “Gaëtan”, typing “gae” will match it. This is done using g_unicode_canonical_decomposition() and keep only the first unicode.

I’m writing unit tests for that matching algorithm to make sure it is working as wanted. Being French speaker, I can easily test that letters éèçàï, etc are stripped correctly to keep only the base letter without the accentuation marks. But I would like to include tests in other non-latin alphabets, like Arabic/Chinese/Corean/etc. I don’t know if such “accentuation marks” that can be stripped makes sense in any other alphabet, but if you know, please give me some example strings.

Strings must be encoded in UTF-8 of course!


Update: Empathy in git master now has the live search merged. Please give it a try and see if it maches your needs. It has the matching algorith described above, surely not perfect in all languages, but already better than nothing.

Of course, I’m interested in feedback, does it fail horribly with your language, or is it acceptable? All I can tell is it is perfect in French :D

The nVidia “nouveau” driver

I’m using an “old” laptop with an nvidia geforce7 mainly as media center connected on my TV. Getting TV-Out working with the nvidia card always was a pain, had to install proprietary driver, pasting chrunks of settings found on random forums to xorg.conf, and repeat until it decide to work. Had to restart X server each time I want to switch from LCD to TV screen.

Recently I upgraded it (actually made fresh install) to Ubuntu Lucid, was prepared to spent hours to get the tvout working again… But I got totally impressed by the new “nouveau” driver installed by default now, TV-Out was working out of the box, I can setup it easily with gnome-display-properties, even the fn+F7 key binding was working to switch display between LCD-only, TV-only or clone TV-LCD.

So I decided to share this good news, thanks to all devs that made that possible! OpenSource: 1, nVidia: 0.

Empathy getting contact vCard support

Telepathy spec had for some times now the ‘ContactInfo’ interface to get a vCard from our IM contacts, and set one for ourself. This is currently only supported by telepathy-gabble (The jabber backend).

Now I added high-level API in telepathy-glib to get those vCard information from a TpContact and set our self vCard on a TpConnection. I also added UI in Empathy to view IM contact’s vCard and edit our own vCard.

mandatory screenshots:

The code for this is not yet merged, it is waiting for review. You can find git branches:

telepathy-glib and empathy

Update: This is not related to metacontacts. Current plan for that is using libfolks which is being developped by Collabora right now.

Ubuntu Lucid – indicate

I upgraded to ubuntu Lucid yesterday, and I was totally disappointed with the new user experience they are trying^Wforcing with their ‘indicate’ applet.

At first, I was not using indicate applet in Karmic, so after the upgrade I didn’t have the indicate applet neither.

  • Rhythmbox’s icon when not playing was modified to be blank&white but the icon when playing was not modified, so big inconsistency in the style.
  • Rhythmbox’s status icon behaviour is modified: it does not play/pause when middle click, right-click does nothing, left-click popup a revisited context-menu. There is no way to show/hide rb when clicking the status icon. Scrolling on the status icon does not change the volume of the playback anymore.
  • I don’t have the bluethoot icon anymore, but tbh it’s fine because I don’t use it anyway. But still, I see no way to add it back.
  • The volume applet is also removed from my panel with no way to add it back.

Then I decided to give a try to indicate applet, I get 4 icons:

  1. bluetooth: exactly the same than without indicate, no way to remove it;
  2. rhythmbox: with all the issues mentioned above;
  3. volume: exactly the same than without indicate, they just made the bar horizontal instead of vertical;
  4. IM: probably the worst, here are issues I had:
    • It force using evolution so it’s useless for thunderbird users like me.
    • the menu shows random contacts in it, I had no idea for which reason contacts appeared… turned out that it’s the last login/logout contact… there is no notification for that, so unless you have always the menu open you can’t understand any reason those contact are there.
    • Incoming call dialog to accept/reject the call steal your focus, so if you were typing, it will reject the call. Empathy upstream fix that by blinking the status icon instead of poping a dialog. Yes, WM people claims that’s fixed 15years ago, blablabla, but no, poping a dialog STEALS the focus.
    • incoming message just turn the icon green, nothing blinking, so it’s really hard to notice. Even with upstream behaviour where the icon is blinking, lots of users complain it’s not noticable…
    • how am I supposed to know if I’m connected to IM??? When booting it does not connect IM accounts automatically, I have to click the IM indicator applet and open the contact list, and then magically it connects my accounts… how discoverable is that??? Using Empathy upstream, you directly see in the notification area an icon for your presence, and if you didn’t start empathy, you see that the icon is not there. In contrast the indicator IM applet is always there with no visual difference for your presence.

As an empathy developer I would like to add a comment on the very poor communication they had with us. Last year they started patching Empathy to use libindicate. They pushed packages in ubuntu karmic (when it was still in dev) without consulting upstream at all. They pushed empathy packages as we use “git commit” and opened an upstream bug attaching the ‘final’ patch. Upstream made an enormous list of comments pointing issues with the patch. While they fixed most of them, we still got lot of bugs reported in upstream by ubuntu users, adding more work for upstream dev. Guillaume Desmottes even lost several *days* of work to fix a nasty empathy crasher that turned out to be ubuntu’s patch fault.

So my conclusion, for my personal use case (maybe other users are happy with it?) that indicator is at best the same as upstream behaviour, but what they changed is getting worst. I don’t blame Ubuntu for trying new user experience, it was a good idea to explore, really. But what makes me totally disappointed is that there is no way to get back to the upstream behaviour if the user choose to not have the indicator applet.

How to make a GObject singleton

A while back some people asked me to blog about how to make a GObject singleton. I think we are doing it right in Empathy’s code.

The most common way of doing a singleton is to add a function like that:

foo_bar_get_default (void)
  static FooBar *self = NULL;

  if (self == NULL)
    self = foo_bar_new ();

  return self;

It means that you should never unref the return value, and the singleton is leaked for the entire live of the process (unless you play some atexit magic). It also means that g_object_new(FOO_TYPE_BAR, NULL) will return a new object and not a singleton, which is not friendly for bindings.

Here is how we are doing it most of the time in Empathy:

static GObject*
constructor (GType type,
                 guint n_construct_params,
                 GObjectConstructParam *construct_params)
  static GObject *self = NULL;

  if (self == NULL)
      self = G_OBJECT_CLASS (foo_bar_parent_class)->constructor (
          type, n_construct_params, construct_params);
      g_object_add_weak_pointer (self, (gpointer) &self);
      return self;

  return g_object_ref (self);

static void
foo_bar_class_init (FooBarClass *klass)
  GObjectClass *object_class = G_OBJECT_CLASS (klass);

  object_class->constructor = constructor;

With that code, g_object_new() will return a singleton, and will always return a new ref. That means that you have to call g_object_unref() on the singleton once you don’t need it anymore, just like any normal object. If the last user of the singleton drops its ref, then the object is finalized (so there is no leak) and next time someone needs the singleton, a new one will be created (thanks to the weak pointer).

Of course to avoid object create/destroy ping-pong, you could want to keep a ref for the whole live of the process anyway, it really depend on your needs. But if you are writing a library, you cannot know in advance if the object will be needed for the whole live of the process, so it’s better to let the program using the library decide by managing the refcount itself.

Update: Thanks to Rony and Alexander for pointing me that this is not thread-safe. I think we have to use a mutex in that case. If someone has a better idea, please tell me :)