]> git.0d.be Git - empathy.git/blobdiff - libempathy/empathy-client-factory.c
Merge remote-tracking branch 'jonny/ft'
[empathy.git] / libempathy / empathy-client-factory.c
index f7529bf2e590177e98dbe2d30ddd4d5e918cb343..035c5695625fb5404c8754c4a944d4e86824f811 100644 (file)
@@ -24,7 +24,6 @@
 #include "empathy-client-factory.h"
 
 #include "empathy-tp-chat.h"
-#include "empathy-tp-file.h"
 #include "empathy-utils.h"
 
 #include <telepathy-yell/telepathy-yell.h>
@@ -89,11 +88,6 @@ empathy_client_factory_create_channel (TpSimpleClientFactory *factory,
       return TP_CHANNEL (call_channel_new_with_factory (
             TP_SIMPLE_CLIENT_FACTORY (factory), conn, path, properties, error));
     }
-  else if (!tp_strdiff (chan_type, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER))
-    {
-      return TP_CHANNEL (empathy_tp_file_new (
-            TP_SIMPLE_CLIENT_FACTORY (factory), conn, path, properties, error));
-    }
 
   return chainup->create_channel (factory, conn, path, properties, error);
 }
@@ -158,6 +152,33 @@ empathy_client_factory_dup_connection_features (TpSimpleClientFactory *factory,
   feature = TP_CONNECTION_FEATURE_BALANCE;
   g_array_append_val (features, feature);
 
+  feature = TP_CONNECTION_FEATURE_CONTACT_BLOCKING;
+  g_array_append_val (features, feature);
+
+  /* Most empathy-* may allow user to add a contact to his contact list. We
+   * need this property to check if the connection allows it. It's cheap to
+   * prepare anyway as it will just call GetAll() on the ContactList iface. */
+  feature = TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES;
+  g_array_append_val (features, feature);
+
+  return features;
+}
+
+static GArray *
+empathy_client_factory_dup_contact_features (TpSimpleClientFactory *factory,
+        TpConnection *connection)
+{
+  GArray *features;
+  TpContactFeature feature;
+
+  features = chainup->dup_contact_features (factory, connection);
+
+  /* Needed by empathy_individual_add_menu_item_new to check if a contact is
+   * already in the contact list. This feature is pretty cheap to prepare as
+   * it doesn't prepare the full roster. */
+  feature = TP_CONTACT_FEATURE_SUBSCRIPTION_STATES;
+  g_array_append_val (features, feature);
+
   return features;
 }
 
@@ -175,6 +196,9 @@ empathy_client_factory_class_init (EmpathyClientFactoryClass *cls)
 
   simple_class->dup_connection_features =
     empathy_client_factory_dup_connection_features;
+
+  simple_class->dup_contact_features =
+    empathy_client_factory_dup_contact_features;
 }
 
 static void