diff options
author | Xavier Claessens <xclaesse@src.gnome.org> | 2008-04-15 19:26:08 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2008-04-15 19:26:08 +0800 |
commit | 44e6d095cff7b1bd9e09d7d6f4f375679ee59ded (patch) | |
tree | a2a0d1dc6c0041b1dc0aba13b10c370e96606fbc /libempathy | |
parent | 30abba7499230b0a5bf2606317f28dc7dd350d6a (diff) | |
download | gsoc2013-empathy-44e6d095cff7b1bd9e09d7d6f4f375679ee59ded.tar gsoc2013-empathy-44e6d095cff7b1bd9e09d7d6f4f375679ee59ded.tar.gz gsoc2013-empathy-44e6d095cff7b1bd9e09d7d6f4f375679ee59ded.tar.bz2 gsoc2013-empathy-44e6d095cff7b1bd9e09d7d6f4f375679ee59ded.tar.lz gsoc2013-empathy-44e6d095cff7b1bd9e09d7d6f4f375679ee59ded.tar.xz gsoc2013-empathy-44e6d095cff7b1bd9e09d7d6f4f375679ee59ded.tar.zst gsoc2013-empathy-44e6d095cff7b1bd9e09d7d6f4f375679ee59ded.zip |
Get the chat ID only if the handle and handle_type are != 0. Get the remote_contact from the channel's handle if it's of type CONTACT.
svn path=/trunk/; revision=945
Diffstat (limited to 'libempathy')
-rw-r--r-- | libempathy/empathy-tp-chat.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c index 43c760579..07d59cd84 100644 --- a/libempathy/empathy-tp-chat.c +++ b/libempathy/empathy-tp-chat.c @@ -731,8 +731,6 @@ tp_chat_channel_ready_cb (EmpathyTpChat *chat) EmpathyTpChatPriv *priv = GET_PRIV (chat); TpConnection *connection; guint handle, handle_type; - GArray *handles; - gchar **names; empathy_debug (DEBUG_DOMAIN, "Channel ready"); @@ -742,15 +740,26 @@ tp_chat_channel_ready_cb (EmpathyTpChat *chat) "handle_type", &handle_type, NULL); - handles = g_array_new (FALSE, FALSE, sizeof (guint)); - g_array_append_val (handles, handle); - tp_cli_connection_run_inspect_handles (connection, -1, - handle_type, handles, - &names, NULL, NULL); - g_array_free (handles, TRUE); + if (handle_type != TP_HANDLE_TYPE_NONE && handle != 0) { + GArray *handles; + gchar **names; + + handles = g_array_new (FALSE, FALSE, sizeof (guint)); + g_array_append_val (handles, handle); + tp_cli_connection_run_inspect_handles (connection, -1, + handle_type, handles, + &names, NULL, NULL); + priv->id = *names; + g_array_free (handles, TRUE); + g_free (names); + } - priv->id = *names; - g_free (names); + if (handle_type == TP_HANDLE_TYPE_CONTACT && handle != 0) { + priv->remote_contact = empathy_contact_factory_get_from_handle (priv->factory, + priv->account, + handle); + g_object_notify (G_OBJECT (chat), "remote-contact"); + } if (tp_proxy_has_interface_by_id (priv->channel, TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP)) { @@ -766,11 +775,6 @@ tp_chat_channel_ready_cb (EmpathyTpChat *chat) G_CALLBACK (tp_chat_local_pending_cb), chat); empathy_run_until_ready (priv->group); - } else { - priv->remote_contact = empathy_contact_factory_get_from_handle (priv->factory, - priv->account, - handle); - g_object_notify (G_OBJECT (chat), "remote-contact"); } if (tp_proxy_has_interface_by_id (priv->channel, |