]> git.0d.be Git - empathy.git/blobdiff - src/empathy.c
Move should_create_salut_account to local-xmpp-assistant-widget
[empathy.git] / src / empathy.c
index b73bf1b038c47fb5e9d3e5204e4ca0ed04c788eb..f59a54f17f7c559ec41512f87077c5a5b95e5ee4 100644 (file)
@@ -48,6 +48,8 @@
 
 #include <telepathy-logger/log-manager.h>
 
+#include <libempathy/empathy-client-factory.h>
+#include <libempathy/empathy-connection-aggregator.h>
 #include <libempathy/empathy-presence-manager.h>
 #include <libempathy/empathy-utils.h>
 #include <libempathy/empathy-chatroom-manager.h>
@@ -63,7 +65,7 @@
 #include <libempathy-gtk/empathy-location-manager.h>
 #include <libempathy-gtk/empathy-notify-manager.h>
 
-#include "empathy-main-window.h"
+#include "empathy-roster-window.h"
 #include "empathy-accounts-common.h"
 #include "empathy-accounts-dialog.h"
 #include "empathy-status-icon.h"
@@ -122,6 +124,7 @@ struct _EmpathyApp
   EmpathyConnectivity *connectivity;
   GSettings *gsettings;
   EmpathyNotificationsApprover *notifications_approver;
+  EmpathyConnectionAggregator *conn_aggregator;
 #ifdef HAVE_GEOCLUE
   EmpathyLocationManager *location_manager;
 #endif
@@ -167,6 +170,7 @@ empathy_app_dispose (GObject *object)
   tp_clear_object (&self->ft_factory);
   tp_clear_object (&self->gsettings);
   tp_clear_object (&self->notifications_approver);
+  tp_clear_object (&self->conn_aggregator);
 
   if (dispose != NULL)
     dispose (object);
@@ -285,8 +289,8 @@ out:
       /* Rely on GNOME Shell to watch session state */
       empathy_presence_manager_set_auto_away (self->presence_mgr, FALSE);
 
-      empathy_main_window_set_shell_running (EMPATHY_MAIN_WINDOW (self->window),
-                                             TRUE);
+      empathy_roster_window_set_shell_running (
+          EMPATHY_ROSTER_WINDOW (self->window), TRUE);
     }
   else
     {
@@ -351,7 +355,7 @@ empathy_app_command_line (GApplication *app,
       self->activated = TRUE;
 
       /* Setting up UI */
-      self->window = empathy_main_window_dup ();
+      self->window = empathy_roster_window_dup ();
 
       gtk_application_add_window (GTK_APPLICATION (app),
           GTK_WINDOW (self->window));
@@ -377,8 +381,8 @@ empathy_app_command_line (GApplication *app,
     }
 
   if (self->show_preferences)
-    empathy_main_window_show_preferences (EMPATHY_MAIN_WINDOW (self->window),
-        self->preferences_tab);
+    empathy_roster_window_show_preferences (
+        EMPATHY_ROSTER_WINDOW (self->window), self->preferences_tab);
 
   if (!self->start_hidden)
     empathy_window_present (GTK_WINDOW (self->window));
@@ -808,11 +812,34 @@ empathy_app_constructed (GObject *object)
   self->location_manager = empathy_location_manager_dup_singleton ();
 #endif
 
+  self->conn_aggregator = empathy_connection_aggregator_dup_singleton ();
+
   self->activated = FALSE;
   self->ft_factory = NULL;
   self->window = NULL;
 }
 
+static void
+add_empathy_features (void)
+{
+  /* Add 'empathy' specific feature before doing any preparation */
+  EmpathyClientFactory *factory;
+
+  factory = empathy_client_factory_dup ();
+
+  tp_simple_client_factory_add_connection_features_varargs (
+      TP_SIMPLE_CLIENT_FACTORY (factory),
+      /* empathy_connection_aggregator_get_all_groups(), used by
+       * EmpathyGroupsWidget relies on it */
+      TP_CONNECTION_FEATURE_CONTACT_GROUPS,
+      /* empathy_connection_aggregator_dup_all_contacts(), used by
+       * EmpathyEventManager relies on it */
+      TP_CONNECTION_FEATURE_CONTACT_LIST,
+      NULL);
+
+  g_object_unref (factory);
+}
+
 int
 main (int argc, char *argv[])
 {
@@ -832,6 +859,8 @@ main (int argc, char *argv[])
   gtk_init (&argc, &argv);
   empathy_gtk_init ();
 
+  add_empathy_features ();
+
   app = g_object_new (EMPATHY_TYPE_APP,
       "application-id", EMPATHY_DBUS_NAME,
       "flags", G_APPLICATION_HANDLES_COMMAND_LINE,