aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2009-09-21 03:53:14 +0800
committerXavier Claessens <xclaesse@gmail.com>2009-09-21 03:53:14 +0800
commitdb0a8206853d58375960fabe1ae38267ba0576ec (patch)
tree49b35917bce6cc2e9fdf32219e2b932939532f47 /libempathy
parent3f69fecb7d8405f7a9e3c8e7b34665e536b7de0c (diff)
parent1ca52da13f25b623adb55127aee61c6ea2f68bea (diff)
downloadgsoc2013-empathy-db0a8206853d58375960fabe1ae38267ba0576ec.tar
gsoc2013-empathy-db0a8206853d58375960fabe1ae38267ba0576ec.tar.gz
gsoc2013-empathy-db0a8206853d58375960fabe1ae38267ba0576ec.tar.bz2
gsoc2013-empathy-db0a8206853d58375960fabe1ae38267ba0576ec.tar.lz
gsoc2013-empathy-db0a8206853d58375960fabe1ae38267ba0576ec.tar.xz
gsoc2013-empathy-db0a8206853d58375960fabe1ae38267ba0576ec.tar.zst
gsoc2013-empathy-db0a8206853d58375960fabe1ae38267ba0576ec.zip
Merge commit 'istaz/handle_none'
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-tp-chat.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c
index a8b0eeb6f..28b97076d 100644
--- a/libempathy/empathy-tp-chat.c
+++ b/libempathy/empathy-tp-chat.c
@@ -1251,10 +1251,19 @@ const gchar *
empathy_tp_chat_get_id (EmpathyTpChat *chat)
{
EmpathyTpChatPriv *priv = GET_PRIV (chat);
+ const gchar *id;
+
g_return_val_if_fail (EMPATHY_IS_TP_CHAT (chat), NULL);
- return tp_channel_get_identifier (priv->channel);
+ id = tp_channel_get_identifier (priv->channel);
+ if (!EMP_STR_EMPTY (id))
+ return id;
+ else if (priv->remote_contact)
+ return empathy_contact_get_id (priv->remote_contact);
+ else
+ return NULL;
+
}
EmpathyContact *