void empathy_init (void) { static gboolean initialized = FALSE; TpAccountManager *am; EmpathyClientFactory *factory; if (initialized) return; g_type_init (); /* Setup gettext */ bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); /* Setup debug output for empathy and telepathy-glib */ if (g_getenv ("EMPATHY_TIMING") != NULL) g_log_set_default_handler (tp_debug_timestamped_log_handler, NULL); empathy_debug_set_flags (g_getenv ("EMPATHY_DEBUG")); tp_debug_divert_messages (g_getenv ("EMPATHY_LOGFILE")); emp_cli_init (); initialized = TRUE; factory = empathy_client_factory_dup (); am = tp_account_manager_new_with_factory (TP_SIMPLE_CLIENT_FACTORY (factory)); tp_account_manager_set_default (am); g_object_unref (factory); g_object_unref (am); }
void goa_utils_initialize_client_factory (void) { static gsize once_init_value = 0; if (g_once_init_enter (&once_init_value)) { TpSimpleClientFactory *factory; TpAccountManager *account_manager; GQuark account_features[] = {TP_ACCOUNT_FEATURE_STORAGE, TP_ACCOUNT_FEATURE_CONNECTION, 0}; GQuark connection_features[] = {TP_CONNECTION_FEATURE_AVATAR_REQUIREMENTS, TP_CONNECTION_FEATURE_CONTACT_INFO, 0}; /* We make sure that new instances of Telepathy objects will have all * the features we need. */ factory = tp_simple_client_factory_new (NULL); tp_simple_client_factory_add_account_features (factory, account_features); tp_simple_client_factory_add_connection_features (factory, connection_features); account_manager = tp_account_manager_new_with_factory (factory); tp_account_manager_set_default (account_manager); g_object_unref (account_manager); g_object_unref (factory); g_once_init_leave (&once_init_value, 1); } }