From 6fe758a0d83f6872585a177a2e821d4105642308 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Thu, 31 May 2007 06:34:41 +0000 Subject: Fix warning when selecting all accounts. 2007-05-31 Xavier Claessens * libempathy-gtk/gossip-account-chooser.c: Fix warning when selecting all accounts. * src/empathy-accounts-main.c: * libempathy-gtk/empathy-status-icon.c: * libempathy-gtk/gossip-accounts-dialog.h: * libempathy-gtk/gossip-accounts-dialog.c: * libempathy-gtk/gossip-preferences.h: * libempathy-gtk/gossip-preferences.c: Set parent window. * libempathy-gtk/empathy-main-window.c: Implement favorite chatroom menu and fix a leak. * libempathy-gtk/Makefile.am: * libempathy/Makefile.am: * libempathy/gossip-chatroom.c: * libempathy/gossip-chatroom.h: * libempathy/gossip-chatroom-manager.c: * libempathy/gossip-chatroom-manager.h: * libempathy/gossip-chatroom-manager.dtd: * libempathy-gtk/gossip-chatrooms-window.glade: * libempathy-gtk/gossip-chatrooms-window.c: * libempathy-gtk/gossip-chatrooms-window.h: New files to implement favorite chatrooms and a window to show them. * libempathy-gtk/gossip-chat.c: Fix tooltip leaked. * libempathy-gtk/gossip-chat-window.h: * libempathy-gtk/gossip-chat-window.c: Do not use deprecated gtk_object_sink(). Implement favorite chatroom features. Find a chat by comparing the account AND the chat ID. * src/empathy-chat-main.c: * libempathy/empathy-tp-chat.h: * libempathy/empathy-tp-chat.c: * libempathy/gossip-utils.h: * libempathy/gossip-utils.c: empathy_tp_chat_get_id() returns the Text channel's name. The chat ID is unique only for a specified account. * libempathy/empathy-tp-contact-list.c: Fix some leaks and add a FIXME comment for a leak not yet fixed. * TODO: Would be cool to have a glade catalog for libempathy-gtk. svn path=/trunk/; revision=100 --- libempathy/empathy-tp-chat.c | 56 +------------------------------------------- 1 file changed, 1 insertion(+), 55 deletions(-) (limited to 'libempathy/empathy-tp-chat.c') diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c index 3c4f55423..ed6a49323 100644 --- a/libempathy/empathy-tp-chat.c +++ b/libempathy/empathy-tp-chat.c @@ -488,65 +488,11 @@ empathy_tp_chat_get_id (EmpathyTpChat *chat) return priv->id; } - priv->id = empathy_tp_chat_build_id_for_chan (priv->account, priv->tp_chan); + priv->id = gossip_get_channel_id (priv->account, priv->tp_chan); return priv->id; } -gchar * -empathy_tp_chat_build_id (McAccount *account, - const gchar *contact_id) -{ - /* A handle name is unique only for a specific account */ - return g_strdup_printf ("%s/%s", - mc_account_get_unique_name (account), - contact_id); -} - -gchar * -empathy_tp_chat_build_id_for_chan (McAccount *account, - TpChan *tp_chan) -{ - MissionControl *mc; - TpConn *tp_conn; - GArray *handles; - gchar **names; - gchar *id; - GError *error = NULL; - - g_return_val_if_fail (MC_IS_ACCOUNT (account), NULL); - g_return_val_if_fail (TELEPATHY_IS_CHAN (tp_chan), NULL); - - mc = gossip_mission_control_new (); - tp_conn = mission_control_get_connection (mc, account, NULL); - g_object_unref (mc); - - /* Get the handle's name */ - handles = g_array_new (FALSE, FALSE, sizeof (guint)); - g_array_append_val (handles, tp_chan->handle); - if (!tp_conn_inspect_handles (DBUS_G_PROXY (tp_conn), - tp_chan->handle_type, - handles, - &names, - &error)) { - gossip_debug (DEBUG_DOMAIN, - "Couldn't get id: %s", - error ? error->message : "No error given"); - g_clear_error (&error); - g_array_free (handles, TRUE); - g_object_unref (tp_conn); - - return NULL; - } - - id = empathy_tp_chat_build_id (account, *names); - - g_strfreev (names); - g_object_unref (tp_conn); - - return id; -} - static void tp_chat_destroy_cb (TpChan *text_chan, EmpathyTpChat *chat) -- cgit v1.2.3