changeset 15983:20c0ab6ea008

sf patch #1574238, from Ka-Hing Cheung "icq away message was only showing in blist and tooltip, this patch adds it to the info window so it can be copy and pasted."
author Mark Doliner <mark@kingant.net>
date Mon, 02 Apr 2007 00:38:21 +0000
parents c0e33c71e900
children 50d949d6bda2 6dc5dc83a61b
files libpurple/protocols/oscar/oscar.c
diffstat 1 files changed, 22 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/oscar/oscar.c	Sun Apr 01 19:39:33 2007 +0000
+++ b/libpurple/protocols/oscar/oscar.c	Mon Apr 02 00:38:21 2007 +0000
@@ -3667,6 +3667,8 @@
 	PurpleConnection *gc;
 	PurpleAccount *account;
 	PurpleBuddy *buddy;
+	PurplePresence *presence;
+	PurpleStatus *status;
 	struct buddyinfo *bi;
 	gchar who[16];
 	PurpleNotifyUserInfo *user_info;
@@ -3760,7 +3762,26 @@
 		g_free(buf);
 		g_free(utf8);
 	}
-	
+
+	if (buddy != NULL) {
+		const gchar *message;
+		gchar *utf8, *tmp;
+
+		presence = purple_buddy_get_presence(buddy);
+		status = purple_presence_get_active_status(presence);
+		message = purple_status_get_attr_string(status, "message");
+
+		utf8 = message && message[0] ? oscar_utf8_try_convert(account, message) : NULL;
+		tmp = g_strdup_printf("%s%s%s",
+				purple_status_get_name(status),
+				utf8 && *utf8 ? ": " : "",
+				utf8 && *utf8 ? utf8 : "");
+		g_free(utf8);
+
+		oscar_user_info_convert_and_add(account,
+				user_info, _("Status"), tmp);
+	}
+
 	oscar_user_info_convert_and_add(account, user_info, _("Additional Information"), info->info);
 	purple_notify_user_info_add_section_break(user_info);