Bug 56079

Summary: select preferred Client to handle incoming messages
Product: Telepathy Reporter: Lucien <lucien.hantute>
Component: generalAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED NOTOURBUG QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium CC: xclaesse
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: dbus-monitor log while receiving a message

Description Lucien 2012-10-17 10:09:38 UTC
Not 100% sure I'm posting this in the right place, but from the few hits I got on Google, looks like it's the most probable.

I usually run gnome (3) 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
Comment 1 Xavier Claessens 2012-10-17 10:31:23 UTC
MissionControl is supposed to prefer running handlers over handlers that can be dbus-activated. gnome-shell being a chat handler, it will catch the channels and display the notification chat. Clicking that notification gnome-shell will delegate the channel explicitly to empathy.

If you're in KDE session, I don't know if they have any handler running by default like we do with gnome-shell. In that case no handler is running so MissionControl has no way to decide, so probably it will pick one in "random". So I would suggest to KDE people to add an approver in their session that calls HandleWith[1] to give the channel to ktp-text-ui.

This is of course the theory, I'm not sure it actually works :)

[1] http://telepathy.freedesktop.org/spec/Channel_Dispatch_Operation.html#Method:HandleWithTime
Comment 2 Xavier Claessens 2012-10-17 10:46:46 UTC
What could help telling what's going wrong:

1) make sure you're online
2) open a terminal and run dbus-monitor > log
3) receive a msg
4) stop dbus-monitor with ctr-c
5) attach log file here
Comment 3 Lucien 2012-10-17 11:28:59 UTC
Created attachment 68685 [details]
dbus-monitor log while receiving a message

Thanks for your quick reply, Xavier, here is the log.
Comment 4 Xavier Claessens 2012-10-17 12:14:44 UTC
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 5 Lucien 2012-10-17 12:37:18 UTC
I took the logs in gnome-shell, version 3.4.2, and the thing happens exactly as you describe it.

Thanks for your quick and efficient help, I'll poke around gnome-shell for how to correct this problem, then. But between Gconf, Dconf, and all the hidden configuration options, that's a lot of reading. ^^
Comment 6 Xavier Claessens 2012-10-17 12:42:45 UTC
There is no config for this, gnome-shell should just always prefer empathy over all other handlers since it's the official GNOME app.

Closing as NOTOURBUG, but please report it in bugzilla.gnome.org, please attach your logs there as well, and you can quote my comment #4, to give context. It's really sad we cannot move a bug from fd.org to gnome.org :(
Comment 7 Lucien 2012-10-17 13:07:41 UTC
(In reply to comment #6)
> There is no config for this, gnome-shell should just always prefer empathy
> over all other handlers since it's the official GNOME app.
> 
> Closing as NOTOURBUG, but please report it in bugzilla.gnome.org, please
> attach your logs there as well, and you can quote my comment #4, to give
> context. It's really sad we cannot move a bug from fd.org to gnome.org :(

Thanks again, I reported the bug on bugzilla.gnome.org : https://bugzilla.gnome.org/show_bug.cgi?id=686296

Best regards, and keep up the good work!

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.