After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 686296 - empathy is not PreferredHandler
empathy is not PreferredHandler
Product: gnome-shell
Classification: Core
Component: telepathy
Other Linux
: Normal normal
: ---
Assigned To: GNOME Shell Telepathy maintainer(s)
Depends on:
Reported: 2012-10-17 13:02 UTC by Lucien Hantute
Modified: 2012-10-23 10:39 UTC
See Also:
GNOME target: ---
GNOME version: ---

dbus-monitor log while receiving a message (238.36 KB, application/octet-stream)
2012-10-17 13:02 UTC, Lucien Hantute
Telepathy: Set empathy-chat as prefered handler when delegating channels (1.21 KB, patch)
2012-10-17 13:38 UTC, Xavier Claessens
reviewed Details | Review
Telepathy: Set empathy-chat as prefered handler when delegating channels (1.23 KB, patch)
2012-10-17 13:45 UTC, Xavier Claessens
reviewed Details | Review

Description Lucien Hantute 2012-10-17 13:02:48 UTC
Created attachment 226640 [details]
dbus-monitor log while receiving a message

I run gnome-shell (3.4.2) on fedora 17, and decided to try and install KDE too. 

In the process, the ktp packages got installed, and now, when I receive an incoming message (at least text, over google protocol) ktp-text-ui is launched, instead of the usual empathy dialog ui.

I couldn't find a way to set a preferred handler when receiving a new message, neither in dbus nor in empathy/telepathy, and a google search only gave me a cryptic "Setting a prerfferedHandler on ensure_channel will solve this." on an ubuntu bug, on launchpad from last year. 

So, is there a way to set a preferred handler ? Removing ktp-text-ui would work, but I would like to keep it, while getting to chat in empathy when in a Gnome session, and in KDE-telepathy in a KDE session. 

Steps to reproduce 
1. Install KDE (and ktp) and Gnome-shell on the same computer 
2. Connect to google talk using Empathy 
3. Receive an incoming text message 
4. ktp-text-ui is launched

Attached is a log from dbus-monitor at the time a message is received.

I also quote Xavier Claessens' comment on freedesktop's bugzilla, where I initially reported this bug (comment #4 : )

So when you though those logs, you were in gnome-shell, right? which version? When you receive the message, gnome-shell first display a notification, and ktp-text-ui is launched only when you click that notification, right?

From the logs, what I see:
1) AddDispatchOperation is called on gnome-shell
2) gnome-shell claims the channel
3) gnome-shell calls DelegateChannels with Preferred_Handler=""
4) MC decide ktp-text-ui will handle it, this is random choice since MC has no way to know empathy-chat would be preferred.

Since empathy-chat is the GNOME chat handler, I think it would make sense for gnome-shell to give it in the Preferred_Handler, so I would consider this as a gnome-shell bug.

Side note: from the log (did not check what code actually does) it also appear that gnome-shell calls DelegateChannels twice, this is probably armless, but worth fixing as well.
Comment 1 Xavier Claessens 2012-10-17 13:38:02 UTC
Created attachment 226642 [details] [review]
Telepathy: Set empathy-chat as prefered handler when delegating channels
Comment 2 Xavier Claessens 2012-10-17 13:38:29 UTC
did not test the patch since I don't have KDE installed, but that should fix it.
Comment 3 Guillaume Desmottes 2012-10-17 13:42:50 UTC
Review of attachment 226642 [details] [review]:

::: js/ui/components/telepathyClient.js
@@ +558,3 @@
+              this._client.delegate_channels_async([this._channel],
+                  global.get_current_time(),
+                  'org.gnome.Empathy.Chat', null);

you should use the telepathy client bus name, not the GNOME one.
Comment 4 Xavier Claessens 2012-10-17 13:45:47 UTC
Created attachment 226644 [details] [review]
Telepathy: Set empathy-chat as prefered handler when delegating channels
Comment 5 Guillaume Desmottes 2012-10-17 13:47:06 UTC
Review of attachment 226644 [details] [review]:

Comment 6 Xavier Claessens 2012-10-17 13:47:21 UTC
iwanshamir: can you test that patch please? Do you need instructions?
Comment 7 Lucien Hantute 2012-10-19 02:40:03 UTC
Hi, tested the patch, it's working well, thanks a lot.
Comment 8 Xavier Claessens 2012-10-23 10:39:06 UTC
Ok, pushed the commit to both master and 3.6 branch.