[gnome-shell] Allow other clients to preempt the channels we are handling



commit 09f3c87d20f68e99eaf79d600a2900e57f727e9f
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Fri Jun 24 14:29:23 2011 +0200

    Allow other clients to preempt the channels we are handling
    
    This is needed if we are handling an incoming text channel and then user tries
    to open a chat with the same contact using Empathy. In this case, the Shell
    should delegate the channel back to Empathy and just continue observing it as
    it does for usual outgoing channels.
    
    Depends on telepathy-glib 0.15.3 as
    tp_base_client_set_delegated_channels_callback() has been added in this
    version.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=654237

 configure.ac             |    2 +-
 js/ui/telepathyClient.js |   10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 5ec4021..9e4d03c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -73,7 +73,7 @@ GIO_MIN_VERSION=2.25.9
 LIBECAL_MIN_VERSION=2.32.0
 LIBEDATASERVER_MIN_VERSION=1.2.0
 LIBEDATASERVERUI_MIN_VERSION=2.91.6
-TELEPATHY_GLIB_MIN_VERSION=0.15.0
+TELEPATHY_GLIB_MIN_VERSION=0.15.3
 TELEPATHY_LOGGER_MIN_VERSION=0.2.4
 POLKIT_MIN_VERSION=0.100
 STARTUP_NOTIFICATION_MIN_VERSION=0.11
diff --git a/js/ui/telepathyClient.js b/js/ui/telepathyClient.js
index e0bd8d0..5c51f31 100644
--- a/js/ui/telepathyClient.js
+++ b/js/ui/telepathyClient.js
@@ -91,6 +91,11 @@ Client.prototype = {
         this._tpClient.set_handle_channels_func(
             Lang.bind(this, this._handleChannels));
 
+        // Allow other clients (such as Empathy) to pre-empt our channels if
+        // needed
+        this._tpClient.set_delegated_channels_callback(
+            Lang.bind(this, this._delegatedChannelsCb));
+
         try {
             this._tpClient.register();
         } catch (e) {
@@ -245,6 +250,11 @@ Client.prototype = {
                               requests, user_action_time, context) {
         this._handlingChannels(account, conn, channels);
         context.accept();
+    },
+
+    _delegatedChannelsCb: function(client, channels) {
+        // Nothing to do as we don't make a distinction between observed and
+        // handled channels.
     }
 };
 



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