aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorxclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4>2008-04-15 19:26:08 +0800
committerxclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4>2008-04-15 19:26:08 +0800
commite197c3c21f00a3e18c3d733863c8503f2ff46147 (patch)
treea2a0d1dc6c0041b1dc0aba13b10c370e96606fbc /libempathy
parent76991e8e501f25daaf4b73e2e9a6f182ac8ca1e6 (diff)
downloadgsoc2013-empathy-e197c3c21f00a3e18c3d733863c8503f2ff46147.tar
gsoc2013-empathy-e197c3c21f00a3e18c3d733863c8503f2ff46147.tar.gz
gsoc2013-empathy-e197c3c21f00a3e18c3d733863c8503f2ff46147.tar.bz2
gsoc2013-empathy-e197c3c21f00a3e18c3d733863c8503f2ff46147.tar.lz
gsoc2013-empathy-e197c3c21f00a3e18c3d733863c8503f2ff46147.tar.xz
gsoc2013-empathy-e197c3c21f00a3e18c3d733863c8503f2ff46147.tar.zst
gsoc2013-empathy-e197c3c21f00a3e18c3d733863c8503f2ff46147.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.
git-svn-id: svn+ssh://svn.gnome.org/svn/empathy/trunk@945 4ee84921-47dd-4033-b63a-18d7a039a3e4
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-tp-chat.c34
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,