TelepathyClient: use polari for IRC channels

polari is the GNOME app for IRC, empathy is for everything else
So prefer polari to empathy for IRC channels. We don't need
to check that either exists (even though polari is not a core
app) because mission control tries every handler if the preferred
one fails.
Depends on bug 745418 for polari to be mission control activatable.

https://bugzilla.gnome.org/show_bug.cgi?id=745431
This commit is contained in:
Giovanni Campagna 2015-03-02 01:34:06 -08:00
parent f015f4574f
commit 79c04c93e4

View File

@ -537,10 +537,17 @@ const ChatSource = new Lang.Class({
open: function() { open: function() {
if (this._client.is_handling_channel(this._channel)) { if (this._client.is_handling_channel(this._channel)) {
// We are handling the channel, try to pass it to Empathy // We are handling the channel, try to pass it to Empathy or Polari
this._client.delegate_channels_async([this._channel], // (depending on the channel type)
global.get_current_time(), // We don't check if either app is availble - mission control will
'org.freedesktop.Telepathy.Client.Empathy.Chat', null); // fallback to something else if activation fails
let target;
if (this._channel.connection.protocol_name == 'irc')
target = 'org.freedesktop.Telepathy.Client.Polari';
else
target = 'org.freedesktop.Telepathy.Client.Empathy.Chat';
this._client.delegate_channels_async([this._channel], global.get_current_time(), target, null);
} else { } else {
// We are not the handler, just ask to present the channel // We are not the handler, just ask to present the channel
let dbus = Tp.DBusDaemon.dup(); let dbus = Tp.DBusDaemon.dup();