aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-01-10 00:16:14 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2009-01-10 00:16:14 +0800
commit47f59c87daed5af95a9b902fb6c02fae3187c9b2 (patch)
tree0bb8b5d8b275fe158bc5d62d27d95fb5b51c21b0
parent53cf2276bbd450ccbfb1b91ed8c033908b7fc602 (diff)
downloadgsoc2013-empathy-47f59c87daed5af95a9b902fb6c02fae3187c9b2.tar
gsoc2013-empathy-47f59c87daed5af95a9b902fb6c02fae3187c9b2.tar.gz
gsoc2013-empathy-47f59c87daed5af95a9b902fb6c02fae3187c9b2.tar.bz2
gsoc2013-empathy-47f59c87daed5af95a9b902fb6c02fae3187c9b2.tar.lz
gsoc2013-empathy-47f59c87daed5af95a9b902fb6c02fae3187c9b2.tar.xz
gsoc2013-empathy-47f59c87daed5af95a9b902fb6c02fae3187c9b2.tar.zst
gsoc2013-empathy-47f59c87daed5af95a9b902fb6c02fae3187c9b2.zip
Ignore requested channels we didn't request except for text channels, also ignore deprecated channels types and channels for which it doesn't make sense to handle them unless they were requested
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> svn path=/trunk/; revision=2203
-rw-r--r--libempathy/empathy-dispatcher.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/libempathy/empathy-dispatcher.c b/libempathy/empathy-dispatcher.c
index a0d5fbc3d..1827ef78d 100644
--- a/libempathy/empathy-dispatcher.c
+++ b/libempathy/empathy-dispatcher.c
@@ -478,6 +478,16 @@ dispatcher_connection_new_channel (EmpathyDispatcher *dispatcher,
ConnectionData *cd;
EmpathyDispatchOperation *operation;
EmpathyContact *contact = NULL;
+ int i;
+ /* Channel types we never want to dispatch because they're either deprecated
+ * or can't sensibly be dispatch (e.g. channels that should always be
+ * requested) */
+ const char *blacklist[] = {
+ TP_IFACE_CHANNEL_TYPE_CONTACT_LIST,
+ TP_IFACE_CHANNEL_TYPE_TUBES,
+ TP_IFACE_CHANNEL_TYPE_ROOM_LIST,
+ NULL
+ };
cd = g_hash_table_lookup (priv->connections, connection);
@@ -495,8 +505,27 @@ dispatcher_connection_new_channel (EmpathyDispatcher *dispatcher,
if (g_hash_table_lookup (cd->outstanding_channels, object_path) != NULL)
return;
- DEBUG ("New channel of type %s on %s",
- channel_type, object_path);
+ /* Only pick up non-requested text channels. For all other it doesn't make
+ * sense to handle it if we didn't request it. The same goes for channels we
+ * discovered by the Channels property or ListChannels */
+ if (!incoming && tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_TEXT))
+ {
+ DEBUG ("Ignoring incoming channel of type %s on %s",
+ channel_type, object_path);
+ return;
+ }
+
+ for (i = 0 ; blacklist[i] != NULL; i++)
+ {
+ if (!tp_strdiff (channel_type, blacklist[i]))
+ {
+ DEBUG ("Ignoring blacklisted channel type %s on %s",
+ channel_type, object_path);
+ return;
+ }
+ }
+
+ DEBUG ("New channel of type %s on %s", channel_type, object_path);
if (properties == NULL)
channel = tp_channel_new (connection, object_path, channel_type,