Send files to your contacts on your N900
You can share files on your N900 via Bluetooth, E-Mail and web services (Flickr and Facebook) thanks to libsharing-dialog. But there is no file transfers to a contact through instant messaging.

The sharing dialog with Bluetooth, E-Mail and web services features
But look, the sharing dialog is obviously missing a fourth button named “Share via IM”!
Jonny Lamb wrote Monorail, a file transfer application for the N900. Monorail is a standalone application using the Telepathy framework but so far it does not integrate with libsharing-dialog. Libsharing-dialog is supposed to be extensible by plugins (see the Sharing Plug-in documentation). Unfortunately the API is more suitable for web services than for file transfers through instant messenging so it makes the work more difficult.
So I implemented that fourth button with some hacks to workaround the limitations of the libsharing-dialog API:
- The Monorail package dpkg-diverts libsharingdialog.so into /var/lib/funsharing/
- Monorail implements a new library (aka libfunsharing) replacing libsharingdialog.so with the same ABI
- Libfunsharing calls dlopen() on the real libsharingdialog.so
- It also patches the class GtkTable in memory (see struct GObjectClass->constructed) just before calling the real function from libsharingdialog.so, and restore it after the call. I use this hack to get a reference to the GtkDialog and the GtkTable containing the three buttons (the libsharing-dialog API does not give us any reference to these objects)
- In the constructed function of GtkTable, it adds a 4th button “Share via IM” which sends the filenames to share via D-Bus to Monorail
- Monorail receives the filenames from libfunsharing via D-Bus, shows the contact selector and send the files as usual.

The sharing dialog after installing Monorail 0.3
It works fine in the file manager and the image viewer. Do you know any other application with a file sharing feature?
The address book can share contact cards via SMS, Bluetooth and E-Mail but it does not use libsharing-dialog, so Monorail does not automatically add my “Share via IM” button.

Send a contact card from the address book
But since PR1.2, the address book has a new plugin API and it automatically links to your plugins installed in /usr/lib/osso-addressbook/plugins. The plugin API is designed for menu extensions and does not have helper functions for the sharing dialog. But with Marco’s help, I replaced OssoABookSendContactsDialog’s constructed function to add the fourth button:

Send a contact card from the address book after installing Monorail 0.3
Monorail 0.3 is available in maemo extras-devel.
It looks nice but I cannot find it in extras-devel.
Keep up with the good work!
Comment by Rodrigo — July 30, 2010 @ 4:25 pm
great work!
Comment by alex9999 — July 30, 2010 @ 6:45 pm
Hi again…I downloaded one that I found…”file transfer” and it shows up a massage saying that only works with jabber accounts, is it right?
Comment by Rodrigo — July 30, 2010 @ 7:20 pm
How did you work out the details of the libsharingdialog.so ABI so you could replace it safely?
I ask because I also have a project in mind that involves replacing a dialog, namely the dialog you get when you plug in a USB cable, which offers a choice between “Mass storage mode’ and ‘PC Suite mode’. That dialog seems to live in ./hildon-desktop/usb_plugin.so, for which I can find neither source nor documentation.
Comment by Josh — July 30, 2010 @ 7:23 pm
That path should have said /usr/lib/hildon-desktop/usb_plugin.so .
Comment by Josh — July 30, 2010 @ 7:24 pm
Great that developers re-live this great and long awaited idea
but still it does not work properly as the message says japper acount needed only …ect!!?
i really wish this be fully functional soon 

thanx and great work again
Comment by AHMED — July 31, 2010 @ 2:23 am
when will we be able to use it for other im accountsthan jabber PLZ REPLY????
Comment by Anonymous — August 2, 2010 @ 6:35 pm
It works only with IM accounts with File Transfer support. Jabber supports it, but I don’t know about the other IM protocols. MSN has File Transfer but I am not sure the version of telepathy-butterfly in Maemo supports it. It uses the telepathy framework, so if you want to have file transfer in other IM protocols, they should be implemented directly in the relevant Telepathy Connection Manager and the sharing dialog will automatically benefit from it.
I read the file /usr/include/sharingdialog/sharing-dialog.h and used “nm -D /usr/lib/libsharingdialog.so.0.0.0″ to find the list of symbols to implement and keep ABI compatibility.
Comment by Alban — August 5, 2010 @ 11:59 am