[gnome-shell] TelepathyClient: use polari for IRC channels



commit 79c04c93e4cb2f5b4a5da4d9c069b896d25ad5b8
Author: Giovanni Campagna <scampa giovanni gmail com>
Date:   Mon Mar 2 01:34:06 2015 -0800

    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

 js/ui/components/telepathyClient.js |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/components/telepathyClient.js b/js/ui/components/telepathyClient.js
index 881d998..0690fed 100644
--- a/js/ui/components/telepathyClient.js
+++ b/js/ui/components/telepathyClient.js
@@ -537,10 +537,17 @@ const ChatSource = new Lang.Class({
 
     open: function() {
         if (this._client.is_handling_channel(this._channel)) {
-            // We are handling the channel, try to pass it to Empathy
-            this._client.delegate_channels_async([this._channel],
-                                                 global.get_current_time(),
-                                                 'org.freedesktop.Telepathy.Client.Empathy.Chat', null);
+            // We are handling the channel, try to pass it to Empathy or Polari
+            // (depending on the channel type)
+            // We don't check if either app is availble - mission control will
+            // 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 {
             // We are not the handler, just ask to present the channel
             let dbus = Tp.DBusDaemon.dup();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]