changeset 15232:57a208f9d97b

[gaim-migrate @ 18022] gg: Include status message in "Get Info" output. committer: Tailor Script <tailor@pidgin.im>
author Bartoz Oler <bartosz@pidgin.im>
date Tue, 19 Dec 2006 00:09:38 +0000
parents e99816fc2ceb
children 9a44dd7955d6
files libgaim/protocols/gg/gg.c
diffstat 1 files changed, 20 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libgaim/protocols/gg/gg.c	Mon Dec 18 20:29:45 2006 +0000
+++ b/libgaim/protocols/gg/gg.c	Tue Dec 19 00:09:38 2006 +0000
@@ -1014,6 +1014,7 @@
 				   GGPSearchForm *form)
 {
 	GaimNotifyUserInfo *user_info;
+	GaimBuddy *buddy;
 	char *val, *who;
 
 	user_info = gaim_notify_user_info_new();
@@ -1044,13 +1045,29 @@
 	}
 	g_free(val);
 
-	val = ggp_buddy_get_name(gc, ggp_str_to_uin(who));
-	g_free(who);
+	/*
+	 * Include a status message, if exists and buddy is in the blist.
+	 */
+	buddy = gaim_find_buddy(gaim_connection_get_account(gc), who);
+	if (NULL != buddy) {
+		GaimStatus *status;
+		const char *msg;
+		char *text;
 
-/*	val = gaim_strdup_withhtml(text->str); */
+		status = gaim_presence_get_active_status(gaim_buddy_get_presence(buddy));
+		msg = gaim_status_get_attr_string(status, "message");
 
+		if (msg != NULL) {
+			text = g_markup_escape_text(msg, -1);
+			gaim_notify_user_info_add_pair(user_info, _("Message"), text);
+			g_free(text);
+		}
+	}
+
+	val = ggp_buddy_get_name(gc, ggp_str_to_uin(who));
 	gaim_notify_userinfo(gc, val, user_info, ggp_sr_close_cb, form);
 	g_free(val);
+	g_free(who);
 	gaim_notify_user_info_destroy(user_info);
 }
 /* }}} */