# HG changeset patch # User Bartoz Oler # Date 1145218697 0 # Node ID d70f4e25eab50f1d7a57428e051b98d128987458 # Parent 68157ab4e1c9750420602194ae3ba644ffa594cf [gaim-migrate @ 16042] GG PRPL: Display a more meaningful status of a buddy is User Info. committer: Tailor Script diff -r 68157ab4e1c9 -r d70f4e25eab5 src/protocols/gg/gg.c --- a/src/protocols/gg/gg.c Sun Apr 16 18:28:53 2006 +0000 +++ b/src/protocols/gg/gg.c Sun Apr 16 20:18:17 2006 +0000 @@ -975,6 +975,38 @@ } /* }}} */ +/** + * Translate a status' ID to a more user-friendly name. + * + * @param id The ID of the status. + * + * @return The user-friendly name of the status. + */ +/* static const char *ggp_status_by_id(unsigned int id) {{{ */ +static const char *ggp_status_by_id(unsigned int id) +{ + const char *st; + + gaim_debug_info("gg", "ggp_status_by_id: %d\n", id); + switch (id) { + case GG_STATUS_NOT_AVAIL: + st = _("Offline"); + break; + case GG_STATUS_AVAIL: + st = _("Available"); + break; + case GG_STATUS_BUSY: + st = _("Away"); + break; + default: + st = _("Unknown"); + break; + } + + return st; +} +/* }}} */ + /* */ /* static void ggp_pubdir_handle_info(GaimConnection *gc, gg_pubdir50_t req, GGPSearchForm *form) {{{ */ @@ -987,8 +1019,9 @@ text = g_string_new(""); val = ggp_search_get_result(req, 0, GG_PUBDIR50_STATUS); + /* XXX: Use of ggp_str_to_uin() is an ugly hack! */ g_string_append_printf(text, "%s: %s
", - _("Status"), val); + _("Status"), ggp_status_by_id(ggp_str_to_uin(val))); g_free(val); who = ggp_search_get_result(req, 0, GG_PUBDIR50_UIN);