aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-tp-chat.c
diff options
context:
space:
mode:
authorOlivier Le Thanh Duong <olivier@lethanh.be>2009-09-21 00:42:20 +0800
committerOlivier Le Thanh Duong <olivier@lethanh.be>2009-09-21 00:42:20 +0800
commit1ca52da13f25b623adb55127aee61c6ea2f68bea (patch)
treeb6f199ca0e88308eacdb220bbb0a21c84c52e377 /libempathy/empathy-tp-chat.c
parent92d9677c07a4591869cab86b27e21676221cf614 (diff)
downloadgsoc2013-empathy-1ca52da13f25b623adb55127aee61c6ea2f68bea.tar
gsoc2013-empathy-1ca52da13f25b623adb55127aee61c6ea2f68bea.tar.gz
gsoc2013-empathy-1ca52da13f25b623adb55127aee61c6ea2f68bea.tar.bz2
gsoc2013-empathy-1ca52da13f25b623adb55127aee61c6ea2f68bea.tar.lz
gsoc2013-empathy-1ca52da13f25b623adb55127aee61c6ea2f68bea.tar.xz
gsoc2013-empathy-1ca52da13f25b623adb55127aee61c6ea2f68bea.tar.zst
gsoc2013-empathy-1ca52da13f25b623adb55127aee61c6ea2f68bea.zip
Fallback to the contact id if present when there is no room id for empathy_tp_chat
Diffstat (limited to 'libempathy/empathy-tp-chat.c')
-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 *