2 * Copyright (C) 2007-2009 Collabora Ltd.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public
15 * License along with this program; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 * Boston, MA 02110-1301 USA
19 * Authors: Xavier Claessens <xclaesse@gmail.com>
29 #include <glib/gi18n.h>
32 #include <unique/unique.h>
35 #include <clutter-gtk/clutter-gtk.h>
38 #include <libnotify/notify.h>
40 #include <telepathy-glib/account-manager.h>
41 #include <telepathy-glib/dbus.h>
42 #include <telepathy-glib/util.h>
43 #include <telepathy-glib/connection-manager.h>
44 #include <telepathy-glib/interfaces.h>
46 #include <libempathy/empathy-idle.h>
47 #include <libempathy/empathy-utils.h>
48 #include <libempathy/empathy-call-factory.h>
49 #include <libempathy/empathy-chatroom-manager.h>
50 #include <libempathy/empathy-account-settings.h>
51 #include <libempathy/empathy-connectivity.h>
52 #include <libempathy/empathy-connection-managers.h>
53 #include <libempathy/empathy-debugger.h>
54 #include <libempathy/empathy-dispatcher.h>
55 #include <libempathy/empathy-dispatch-operation.h>
56 #include <libempathy/empathy-log-manager.h>
57 #include <libempathy/empathy-ft-factory.h>
58 #include <libempathy/empathy-tp-chat.h>
59 #include <libempathy/empathy-tp-call.h>
61 #include <libempathy-gtk/empathy-conf.h>
62 #include <libempathy-gtk/empathy-ui-utils.h>
63 #include <libempathy-gtk/empathy-location-manager.h>
65 #include "empathy-account-assistant.h"
66 #include "empathy-accounts-dialog.h"
67 #include "empathy-main-window.h"
68 #include "empathy-status-icon.h"
69 #include "empathy-call-window.h"
70 #include "empathy-chat-window.h"
71 #include "empathy-ft-manager.h"
72 #include "empathy-import-mc4-accounts.h"
73 #include "empathy-auto-salut-account-helper.h"
75 #include "extensions/extensions.h"
77 #define DEBUG_FLAG EMPATHY_DEBUG_OTHER
78 #include <libempathy/empathy-debug.h>
82 #define COMMAND_ACCOUNTS_DIALOG 1
84 static gboolean account_dialog_only = FALSE;
85 static gboolean start_hidden = FALSE;
86 static gboolean no_connect = FALSE;
89 dispatch_cb (EmpathyDispatcher *dispatcher,
90 EmpathyDispatchOperation *operation,
95 channel_type = empathy_dispatch_operation_get_channel_type_id (operation);
97 if (channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_TEXT)
99 EmpathyTpChat *tp_chat;
100 EmpathyChat *chat = NULL;
103 tp_chat = EMPATHY_TP_CHAT
104 (empathy_dispatch_operation_get_channel_wrapper (operation));
106 id = empathy_tp_chat_get_id (tp_chat);
107 if (!EMP_STR_EMPTY (id))
109 TpConnection *connection;
112 connection = empathy_tp_chat_get_connection (tp_chat);
113 account = empathy_get_account_for_connection (connection);
114 chat = empathy_chat_window_find_chat (account, id);
119 empathy_chat_set_tp_chat (chat, tp_chat);
123 chat = empathy_chat_new (tp_chat);
124 /* empathy_chat_new returns a floating reference as EmpathyChat is
125 * a GtkWidget. This reference will be taken by a container
126 * (a GtkNotebook) when we'll call empathy_chat_window_present_chat */
129 empathy_chat_window_present_chat (chat);
131 empathy_dispatch_operation_claim (operation);
133 else if (channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_STREAMED_MEDIA)
135 EmpathyCallFactory *factory;
137 factory = empathy_call_factory_get ();
138 empathy_call_factory_claim_channel (factory, operation);
140 else if (channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_FILE_TRANSFER)
142 EmpathyFTFactory *factory;
144 factory = empathy_ft_factory_dup_singleton ();
146 /* if the operation is not incoming, don't claim it,
147 * as it might have been triggered by another client, and
148 * we are observing it.
150 if (empathy_dispatch_operation_is_incoming (operation))
151 empathy_ft_factory_claim_channel (factory, operation);
156 use_conn_notify_cb (EmpathyConf *conf,
160 EmpathyConnectivity *connectivity = user_data;
163 if (empathy_conf_get_bool (conf, key, &use_conn))
165 empathy_connectivity_set_use_conn (connectivity, use_conn);
170 has_non_salut_accounts (TpAccountManager *manager)
172 gboolean ret = FALSE;
175 accounts = tp_account_manager_get_valid_accounts (manager);
177 for (l = accounts ; l != NULL; l = g_list_next (l))
179 if (tp_strdiff (tp_account_get_protocol (l->data), "local-xmpp"))
186 g_list_free (accounts);
192 maybe_show_account_assistant (void)
194 TpAccountManager *manager;
195 manager = tp_account_manager_dup ();
197 if (!has_non_salut_accounts (manager))
198 empathy_account_assistant_show (GTK_WINDOW (empathy_main_window_get ()));
200 g_object_unref (manager);
204 connection_managers_prepare_cb (GObject *source,
205 GAsyncResult *result,
208 EmpathyConnectionManagers *managers = EMPATHY_CONNECTION_MANAGERS (source);
210 if (!empathy_connection_managers_prepare_finish (managers, result, NULL))
213 if (!empathy_import_mc4_accounts (managers) && !start_hidden)
214 maybe_show_account_assistant ();
217 g_object_unref (managers);
221 migrate_config_to_xdg_dir (void)
223 gchar *xdg_dir, *old_dir, *xdg_filename, *old_filename;
225 GFile *xdg_file, *old_file;
226 static const gchar* filenames[] = {
230 "contact-groups.xml",
231 "status-presets.xml",
236 xdg_dir = g_build_filename (g_get_user_config_dir (), PACKAGE_NAME, NULL);
237 if (g_file_test (xdg_dir, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))
239 /* xdg config dir already exists */
244 old_dir = g_build_filename (g_get_home_dir (), ".gnome2",
246 if (!g_file_test (old_dir, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))
248 /* old config dir didn't exist */
254 if (g_mkdir_with_parents (xdg_dir, (S_IRUSR | S_IWUSR | S_IXUSR)) == -1)
256 DEBUG ("Failed to create configuration directory; aborting migration");
262 for (i = 0; filenames[i]; i++)
264 old_filename = g_build_filename (old_dir, filenames[i], NULL);
265 if (!g_file_test (old_filename, G_FILE_TEST_EXISTS))
267 g_free (old_filename);
270 xdg_filename = g_build_filename (xdg_dir, filenames[i], NULL);
271 old_file = g_file_new_for_path (old_filename);
272 xdg_file = g_file_new_for_path (xdg_filename);
274 if (!g_file_move (old_file, xdg_file, G_FILE_COPY_NONE,
275 NULL, NULL, NULL, NULL))
276 DEBUG ("Failed to migrate %s", filenames[i]);
278 g_free (old_filename);
279 g_free (xdg_filename);
280 g_object_unref (old_file);
281 g_object_unref (xdg_file);
289 do_show_accounts_ui (GtkWindow *window,
290 TpAccountManager *manager)
295 if (has_non_salut_accounts (manager))
296 ui = empathy_accounts_dialog_show (window, NULL);
298 ui = empathy_account_assistant_show (window);
300 if (account_dialog_only)
301 g_signal_connect (ui, "destroy",
302 G_CALLBACK (gtk_main_quit), NULL);
306 account_manager_ready_for_accounts_cb (GObject *source_object,
307 GAsyncResult *result,
310 TpAccountManager *manager = TP_ACCOUNT_MANAGER (source_object);
311 GError *error = NULL;
313 if (!tp_account_manager_prepare_finish (manager, result, &error))
315 DEBUG ("Failed to prepare account manager: %s", error->message);
316 g_error_free (error);
320 do_show_accounts_ui (user_data, manager);
324 show_accounts_ui (GtkWindow *window,
327 TpAccountManager *manager;
332 manager = tp_account_manager_dup ();
334 tp_account_manager_prepare_async (manager, NULL,
335 account_manager_ready_for_accounts_cb, window);
337 g_object_unref (manager);
340 static UniqueResponse
341 unique_app_message_cb (UniqueApp *unique_app,
343 UniqueMessageData *data,
347 GtkWindow *window = user_data;
349 DEBUG ("Other instance launched, presenting the main window. "
350 "Command=%d, timestamp %u", command, timestamp);
352 if (command == COMMAND_ACCOUNTS_DIALOG)
354 show_accounts_ui (NULL, TRUE);
358 /* We're requested to show stuff again, disable the start hidden global
359 * in case the accounts wizard wants to pop up.
361 start_hidden = FALSE;
363 show_accounts_ui (window, FALSE);
365 gtk_window_set_screen (GTK_WINDOW (window),
366 unique_message_data_get_screen (data));
367 gtk_window_set_startup_id (GTK_WINDOW (window),
368 unique_message_data_get_startup_id (data));
369 gtk_window_present_with_time (GTK_WINDOW (window), timestamp);
372 return UNIQUE_RESPONSE_OK;
376 show_version_cb (const char *option_name,
381 g_print ("%s\n", PACKAGE_STRING);
389 new_incoming_transfer_cb (EmpathyFTFactory *factory,
390 EmpathyFTHandler *handler,
395 empathy_ft_manager_display_error (handler, error);
397 empathy_receive_file_with_file_chooser (handler);
401 new_ft_handler_cb (EmpathyFTFactory *factory,
402 EmpathyFTHandler *handler,
407 empathy_ft_manager_display_error (handler, error);
409 empathy_ft_manager_add_handler (handler);
411 g_object_unref (handler);
415 new_call_handler_cb (EmpathyCallFactory *factory,
416 EmpathyCallHandler *handler,
420 EmpathyCallWindow *window;
422 window = empathy_call_window_new (handler);
423 gtk_widget_show (GTK_WIDGET (window));
428 default_log_handler (const gchar *log_domain,
429 GLogLevelFlags log_level,
430 const gchar *message,
433 g_log_default_handler (log_domain, log_level, message, NULL);
435 /* G_LOG_DOMAIN = "empathy". No need to send empathy messages to the
436 * debugger as they already have in empathy_debug. */
437 if (log_level != G_LOG_LEVEL_DEBUG
438 || tp_strdiff (log_domain, G_LOG_DOMAIN))
440 EmpathyDebugger *dbg;
443 dbg = empathy_debugger_get_singleton ();
444 g_get_current_time (&now);
446 empathy_debugger_add_message (dbg, &now, log_domain,
450 #endif /* ENABLE_DEBUG */
453 account_manager_ready_cb (GObject *source_object,
454 GAsyncResult *result,
457 TpAccountManager *manager = TP_ACCOUNT_MANAGER (source_object);
458 GError *error = NULL;
460 EmpathyConnectivity *connectivity;
461 gboolean autoconnect = TRUE;
462 TpConnectionPresenceType presence;
464 if (!tp_account_manager_prepare_finish (manager, result, &error))
466 DEBUG ("Failed to prepare account manager: %s", error->message);
467 g_error_free (error);
472 idle = empathy_idle_dup_singleton ();
473 connectivity = empathy_connectivity_dup_singleton ();
475 presence = tp_account_manager_get_most_available_presence (manager, NULL,
478 empathy_conf_get_bool (empathy_conf_get (),
479 EMPATHY_PREFS_AUTOCONNECT, &autoconnect);
480 if (autoconnect && !no_connect &&
481 tp_connection_presence_type_cmp_availability
482 (presence, TP_CONNECTION_PRESENCE_TYPE_OFFLINE)
484 /* if current state is Offline, then put it online */
485 empathy_idle_set_state (idle, TP_CONNECTION_PRESENCE_TYPE_AVAILABLE);
487 if (should_create_salut_account (manager)
488 || !empathy_import_mc4_has_imported ())
490 EmpathyConnectionManagers *managers;
491 managers = empathy_connection_managers_dup_singleton ();
493 empathy_connection_managers_prepare_async (managers,
494 connection_managers_prepare_cb, NULL);
496 else if (!start_hidden)
498 maybe_show_account_assistant ();
501 g_object_unref (idle);
502 g_object_unref (connectivity);
505 static EmpathyDispatcher *
506 setup_dispatcher (void)
508 EmpathyDispatcher *d;
511 const gchar *channeltype;
512 TpHandleType handletype;
514 /* Text channels with handle types none, contact and room */
515 { TP_IFACE_CHANNEL_TYPE_TEXT, TP_HANDLE_TYPE_NONE },
516 { TP_IFACE_CHANNEL_TYPE_TEXT, TP_HANDLE_TYPE_CONTACT },
517 { TP_IFACE_CHANNEL_TYPE_TEXT, TP_HANDLE_TYPE_ROOM },
518 /* file transfer to contacts */
519 { TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, TP_HANDLE_TYPE_CONTACT },
520 /* stream media to contacts */
521 { TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA, TP_HANDLE_TYPE_CONTACT },
523 { TP_IFACE_CHANNEL_TYPE_ROOM_LIST, TP_HANDLE_TYPE_NONE },
525 gchar *capabilities[] = {
526 "org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/ice-udp",
527 "org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/gtalk-p2p",
532 /* Setup the basic Client.Handler that matches our client filter */
533 filters = g_ptr_array_new ();
535 TP_IFACE_CHANNEL ".ChannelType", G_TYPE_STRING,
536 TP_IFACE_CHANNEL_TYPE_TEXT,
537 TP_IFACE_CHANNEL ".TargetHandleType", G_TYPE_INT,
538 TP_HANDLE_TYPE_CONTACT,
540 g_ptr_array_add (filters, asv);
542 d = empathy_dispatcher_new (PACKAGE_NAME, filters, NULL);
544 g_ptr_array_foreach (filters, (GFunc) g_hash_table_destroy, NULL);
545 g_ptr_array_free (filters, TRUE);
547 /* Setup the an extended Client.Handler that matches everything we can do */
548 filters = g_ptr_array_new ();
549 for (i = 0 ; i < G_N_ELEMENTS (types); i++)
552 TP_IFACE_CHANNEL ".ChannelType", G_TYPE_STRING, types[i].channeltype,
553 TP_IFACE_CHANNEL ".TargetHandleType", G_TYPE_INT, types[i].handletype,
556 g_ptr_array_add (filters, asv);
560 TP_IFACE_CHANNEL ".ChannelType",
561 G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA,
562 TP_IFACE_CHANNEL ".TargetHandleType",
563 G_TYPE_INT, TP_HANDLE_TYPE_CONTACT,
564 TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA ".InitialAudio",
565 G_TYPE_BOOLEAN, TRUE,
567 g_ptr_array_add (filters, asv);
570 TP_IFACE_CHANNEL ".ChannelType",
571 G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA,
572 TP_IFACE_CHANNEL ".TargetHandleType",
573 G_TYPE_INT, TP_HANDLE_TYPE_CONTACT,
574 TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA ".InitialVideo",
575 G_TYPE_BOOLEAN, TRUE,
577 g_ptr_array_add (filters, asv);
580 empathy_dispatcher_add_handler (d, PACKAGE_NAME"MoreThanMeetsTheEye",
581 filters, capabilities);
583 g_ptr_array_foreach (filters, (GFunc) g_hash_table_destroy, NULL);
584 g_ptr_array_free (filters, TRUE);
590 account_status_changed_cb (TpAccount *account,
594 gchar *dbus_error_name,
596 EmpathyChatroom *room)
600 conn = tp_account_get_connection (account);
602 empathy_dispatcher_join_muc (conn,
603 empathy_chatroom_get_room (room), NULL, NULL);
607 account_manager_chatroom_ready_cb (GObject *source_object,
608 GAsyncResult *result,
611 TpAccountManager *account_manager = TP_ACCOUNT_MANAGER (source_object);
612 EmpathyChatroomManager *chatroom_manager = user_data;
614 GError *error = NULL;
616 if (!tp_account_manager_prepare_finish (account_manager, result, &error))
618 DEBUG ("Failed to prepare account manager: %s", error->message);
619 g_error_free (error);
623 accounts = tp_account_manager_get_valid_accounts (account_manager);
625 for (l = accounts; l != NULL; l = g_list_next (l))
627 TpAccount *account = TP_ACCOUNT (l->data);
629 GList *chatrooms, *p;
631 conn = tp_account_get_connection (account);
633 chatrooms = empathy_chatroom_manager_get_chatrooms (
634 chatroom_manager, account);
636 for (p = chatrooms; p != NULL; p = p->next)
638 EmpathyChatroom *room = EMPATHY_CHATROOM (p->data);
640 if (!empathy_chatroom_get_auto_connect (room))
645 g_signal_connect (G_OBJECT (account), "status-changed",
646 G_CALLBACK (account_status_changed_cb), room);
650 empathy_dispatcher_join_muc (conn,
651 empathy_chatroom_get_room (room), NULL, NULL);
655 g_list_free (chatrooms);
658 g_list_free (accounts);
662 chatroom_manager_ready_cb (EmpathyChatroomManager *chatroom_manager,
666 TpAccountManager *account_manager = user_data;
668 tp_account_manager_prepare_async (account_manager, NULL,
669 account_manager_chatroom_ready_cb, chatroom_manager);
673 main (int argc, char *argv[])
676 EmpathyLocationManager *location_manager = NULL;
678 EmpathyStatusIcon *icon;
679 EmpathyDispatcher *dispatcher;
680 TpAccountManager *account_manager;
681 EmpathyLogManager *log_manager;
682 EmpathyChatroomManager *chatroom_manager;
683 EmpathyCallFactory *call_factory;
684 EmpathyFTFactory *ft_factory;
687 EmpathyConnectivity *connectivity;
688 GError *error = NULL;
689 TpDBusDaemon *dbus_daemon;
690 UniqueApp *unique_app;
691 gboolean chatroom_manager_ready;
693 GOptionContext *optcontext;
694 GOptionEntry options[] = {
696 0, G_OPTION_ARG_NONE, &no_connect,
697 N_("Don't connect on startup"),
699 { "start-hidden", 'h',
700 0, G_OPTION_ARG_NONE, &start_hidden,
701 N_("Don't display the contact list or any other dialogs on startup"),
704 0, G_OPTION_ARG_NONE, &account_dialog_only,
705 N_("Show the accounts dialog"),
708 G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, show_version_cb,
714 g_thread_init (NULL);
717 optcontext = g_option_context_new (N_("- Empathy IM Client"));
718 g_option_context_add_group (optcontext, gst_init_get_option_group ());
719 g_option_context_add_group (optcontext, gtk_get_option_group (TRUE));
720 #if HAVE_LIBCHAMPLAIN
721 g_option_context_add_group (optcontext, clutter_get_option_group ());
723 g_option_context_add_main_entries (optcontext, options, GETTEXT_PACKAGE);
725 if (!g_option_context_parse (optcontext, &argc, &argv, &error)) {
726 g_print ("%s\nRun '%s --help' to see a full list of available command line options.\n",
727 error->message, argv[0]);
728 g_warning ("Error in empathy init: %s", error->message);
732 g_option_context_free (optcontext);
735 g_set_application_name (_(PACKAGE_NAME));
736 g_setenv ("PULSE_PROP_media.role", "phone", TRUE);
738 gtk_window_set_default_icon_name ("empathy");
739 textdomain (GETTEXT_PACKAGE);
742 /* Set up debugger */
743 g_log_set_default_handler (default_log_handler, NULL);
746 unique_app = unique_app_new_with_commands ("org.gnome.Empathy",
747 NULL, "accounts_dialog", COMMAND_ACCOUNTS_DIALOG, NULL);
749 if (unique_app_is_running (unique_app))
751 unique_app_send_message (unique_app, account_dialog_only ?
752 COMMAND_ACCOUNTS_DIALOG : UNIQUE_ACTIVATE, NULL);
754 g_object_unref (unique_app);
758 /* Take well-known name */
759 dbus_daemon = tp_dbus_daemon_dup (&error);
762 if (!tp_dbus_daemon_request_name (dbus_daemon,
763 "org.gnome.Empathy", TRUE, &error))
765 DEBUG ("Failed to request well-known name: %s",
766 error ? error->message : "no message");
767 g_clear_error (&error);
769 g_object_unref (dbus_daemon);
773 DEBUG ("Failed to dup dbus daemon: %s",
774 error ? error->message : "no message");
775 g_clear_error (&error);
778 if (account_dialog_only)
780 account_manager = tp_account_manager_dup ();
781 show_accounts_ui (NULL, TRUE);
785 g_object_unref (account_manager);
789 notify_init (_(PACKAGE_NAME));
791 /* Setting up Idle */
792 idle = empathy_idle_dup_singleton ();
793 empathy_idle_set_auto_away (idle, TRUE);
795 /* Setting up Connectivity */
796 connectivity = empathy_connectivity_dup_singleton ();
797 use_conn_notify_cb (empathy_conf_get (), EMPATHY_PREFS_USE_CONN,
799 empathy_conf_notify_add (empathy_conf_get (), EMPATHY_PREFS_USE_CONN,
800 use_conn_notify_cb, connectivity);
802 /* account management */
803 account_manager = tp_account_manager_dup ();
804 tp_account_manager_prepare_async (account_manager, NULL,
805 account_manager_ready_cb, NULL);
807 /* Handle channels */
808 dispatcher = setup_dispatcher ();
809 g_signal_connect (dispatcher, "dispatch", G_CALLBACK (dispatch_cb), NULL);
811 migrate_config_to_xdg_dir ();
814 window = empathy_main_window_show ();
815 icon = empathy_status_icon_new (GTK_WINDOW (window), start_hidden);
817 g_signal_connect (unique_app, "message-received",
818 G_CALLBACK (unique_app_message_cb), window);
821 log_manager = empathy_log_manager_dup_singleton ();
822 empathy_log_manager_observe (log_manager, dispatcher);
824 chatroom_manager = empathy_chatroom_manager_dup_singleton (NULL);
825 empathy_chatroom_manager_observe (chatroom_manager, dispatcher);
827 g_object_get (chatroom_manager, "ready", &chatroom_manager_ready, NULL);
828 if (!chatroom_manager_ready)
830 g_signal_connect (G_OBJECT (chatroom_manager), "notify::ready",
831 G_CALLBACK (chatroom_manager_ready_cb), account_manager);
835 chatroom_manager_ready_cb (chatroom_manager, NULL, account_manager);
838 /* Create the call factory */
839 call_factory = empathy_call_factory_initialise ();
840 g_signal_connect (G_OBJECT (call_factory), "new-call-handler",
841 G_CALLBACK (new_call_handler_cb), NULL);
842 /* Create the FT factory */
843 ft_factory = empathy_ft_factory_dup_singleton ();
844 g_signal_connect (ft_factory, "new-ft-handler",
845 G_CALLBACK (new_ft_handler_cb), NULL);
846 g_signal_connect (ft_factory, "new-incoming-transfer",
847 G_CALLBACK (new_incoming_transfer_cb), NULL);
849 /* Location mananger */
851 location_manager = empathy_location_manager_dup_singleton ();
856 empathy_idle_set_state (idle, TP_CONNECTION_PRESENCE_TYPE_OFFLINE);
858 g_object_unref (idle);
859 g_object_unref (connectivity);
860 g_object_unref (icon);
861 g_object_unref (account_manager);
862 g_object_unref (log_manager);
863 g_object_unref (dispatcher);
864 g_object_unref (chatroom_manager);
866 g_object_unref (location_manager);
868 g_object_unref (ft_factory);
869 g_object_unref (unique_app);