From 9647768f6caf2180026c0206be2476ccc77eaccf Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Thu, 21 Apr 2011 22:10:23 -0500 Subject: [PATCH 06/18] Display verified keyID in roster --- src/fe-common/fe-rosters.c | 9 ++++++--- src/fe-common/module-formats.c | 3 ++- src/fe-common/module-formats.h | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) --- a/src/fe-common/fe-rosters.c +++ b/src/fe-common/fe-rosters.c @@ -64,7 +64,7 @@ GSList *tmp; GString *resources; XMPP_ROSTER_RESOURCE_REC *resource; - char *show, *status, *status_str, *priority, *text; + char *show, *status, *status_str, *priority, *text, *pgp_keyid; if (list == NULL) return NULL; @@ -81,9 +81,12 @@ XMPPTXT_FORMAT_RESOURCE_STATUS, status_str); g_free(status_str); priority = g_strdup_printf("%d", resource->priority); + pgp_keyid = !resource->pgp_keyid ? NULL : \ + format_get_text(MODULE_NAME, NULL, server, NULL, + XMPPTXT_FORMAT_PGP_KEYID, resource->pgp_keyid); text = format_get_text(MODULE_NAME, NULL, server, NULL, XMPPTXT_FORMAT_RESOURCE, show, resource->name, priority, - status); + status, pgp_keyid); g_free(show); g_free(status); g_free(priority); @@ -146,7 +149,7 @@ priority = g_strdup_printf("%d", server->priority); text = format_get_text(MODULE_NAME, NULL, server, NULL, XMPPTXT_FORMAT_RESOURCE, show, server->resource, priority, - status); + status, settings_get_str("xmpp_pgp")); g_free(show); g_free(status); g_free(priority); --- a/src/fe-common/module-formats.c +++ b/src/fe-common/module-formats.c @@ -26,10 +26,11 @@ { "format_name", "{nick $0} {nickhost $1}", 2, { 0, 0 } }, { "format_jid", "{nick $0}", 1, { 0 } }, - { "format_resource", "{comment $0{hilight $1}($2)$3}", 4, { 0, 0, 0, 0 } }, + { "format_resource", "{comment $0{hilight $1}($2)$4$3}", 5, { 0, 0, 0, 0, 0 } }, { "format_resource_show", "($0)", 1, { 0 } }, { "format_resource_status", ": $0", 1, { 0 } }, { "format_subscription", "(subscription: $0)", 1, { 0 } }, + { "format_pgp_keyid", "(pgp: $0)", 1, { 0 } }, /* ---- */ { NULL, "Presence", 0, { 0 } }, --- a/src/fe-common/module-formats.h +++ b/src/fe-common/module-formats.h @@ -11,6 +11,7 @@ XMPPTXT_FORMAT_RESOURCE_SHOW, XMPPTXT_FORMAT_RESOURCE_STATUS, XMPPTXT_FORMAT_SUBSCRIPTION, + XMPPTXT_FORMAT_PGP_KEYID, XMPPTXT_FILL_2,