# HG changeset patch # User Bartoz Oler # Date 1166486978 0 # Node ID 57a208f9d97b6664e42cbc0a0b15b729b0fc69c2 # Parent e99816fc2cebf65157001fff0aa7f742e09cd6d4 [gaim-migrate @ 18022] gg: Include status message in "Get Info" output. committer: Tailor Script diff -r e99816fc2ceb -r 57a208f9d97b libgaim/protocols/gg/gg.c --- 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); } /* }}} */