comparison libpurple/protocols/jabber/chat.c @ 23356:1be3301fa2a3

Return the real JID (if available) from the xmpp get_cb_real_name function.
author Daniel Atallah <daniel.atallah@gmail.com>
date Fri, 13 Jun 2008 04:19:31 +0000
parents 5793bcea224c
children 1de1494a13e5
comparison
equal deleted inserted replaced
23354:d33fcdbd6ebc 23356:1be3301fa2a3
340 340
341 char *jabber_chat_buddy_real_name(PurpleConnection *gc, int id, const char *who) 341 char *jabber_chat_buddy_real_name(PurpleConnection *gc, int id, const char *who)
342 { 342 {
343 JabberStream *js = gc->proto_data; 343 JabberStream *js = gc->proto_data;
344 JabberChat *chat; 344 JabberChat *chat;
345 JabberChatMember *jcm;
345 346
346 chat = jabber_chat_find_by_id(js, id); 347 chat = jabber_chat_find_by_id(js, id);
347 348
348 if(!chat) 349 if(!chat)
349 return NULL; 350 return NULL;
351
352 jcm = g_hash_table_lookup(chat->members, who);
353 if (jcm != NULL && jcm->jid)
354 return g_strdup(jcm->jid);
355
350 356
351 return g_strdup_printf("%s@%s/%s", chat->room, chat->server, who); 357 return g_strdup_printf("%s@%s/%s", chat->room, chat->server, who);
352 } 358 }
353 359
354 static void jabber_chat_room_configure_x_data_cb(JabberStream *js, xmlnode *result, gpointer data) 360 static void jabber_chat_room_configure_x_data_cb(JabberStream *js, xmlnode *result, gpointer data)