| 1 |
From 9647768f6caf2180026c0206be2476ccc77eaccf Mon Sep 17 00:00:00 2001 |
| 2 |
From: Stephen Paul Weber <[email protected]> |
| 3 |
Date: Thu, 21 Apr 2011 22:10:23 -0500 |
| 4 |
Subject: [PATCH 06/18] Display verified keyID in roster |
| 5 |
|
| 6 |
--- |
| 7 |
src/fe-common/fe-rosters.c | 9 ++++++--- |
| 8 |
src/fe-common/module-formats.c | 3 ++- |
| 9 |
src/fe-common/module-formats.h | 1 + |
| 10 |
3 files changed, 9 insertions(+), 4 deletions(-) |
| 11 |
|
| 12 |
--- a/src/fe-common/fe-rosters.c |
| 13 |
+++ b/src/fe-common/fe-rosters.c |
| 14 |
@@ -64,7 +64,7 @@ |
| 15 |
GSList *tmp; |
| 16 |
GString *resources; |
| 17 |
XMPP_ROSTER_RESOURCE_REC *resource; |
| 18 |
- char *show, *status, *status_str, *priority, *text; |
| 19 |
+ char *show, *status, *status_str, *priority, *text, *pgp_keyid; |
| 20 |
|
| 21 |
if (list == NULL) |
| 22 |
return NULL; |
| 23 |
@@ -81,9 +81,12 @@ |
| 24 |
XMPPTXT_FORMAT_RESOURCE_STATUS, status_str); |
| 25 |
g_free(status_str); |
| 26 |
priority = g_strdup_printf("%d", resource->priority); |
| 27 |
+ pgp_keyid = !resource->pgp_keyid ? NULL : \ |
| 28 |
+ format_get_text(MODULE_NAME, NULL, server, NULL, |
| 29 |
+ XMPPTXT_FORMAT_PGP_KEYID, resource->pgp_keyid); |
| 30 |
text = format_get_text(MODULE_NAME, NULL, server, NULL, |
| 31 |
XMPPTXT_FORMAT_RESOURCE, show, resource->name, priority, |
| 32 |
- status); |
| 33 |
+ status, pgp_keyid); |
| 34 |
g_free(show); |
| 35 |
g_free(status); |
| 36 |
g_free(priority); |
| 37 |
@@ -146,7 +149,7 @@ |
| 38 |
priority = g_strdup_printf("%d", server->priority); |
| 39 |
text = format_get_text(MODULE_NAME, NULL, server, NULL, |
| 40 |
XMPPTXT_FORMAT_RESOURCE, show, server->resource, priority, |
| 41 |
- status); |
| 42 |
+ status, settings_get_str("xmpp_pgp")); |
| 43 |
g_free(show); |
| 44 |
g_free(status); |
| 45 |
g_free(priority); |
| 46 |
--- a/src/fe-common/module-formats.c |
| 47 |
+++ b/src/fe-common/module-formats.c |
| 48 |
@@ -26,10 +26,11 @@ |
| 49 |
|
| 50 |
{ "format_name", "{nick $0} {nickhost $1}", 2, { 0, 0 } }, |
| 51 |
{ "format_jid", "{nick $0}", 1, { 0 } }, |
| 52 |
- { "format_resource", "{comment $0{hilight $1}($2)$3}", 4, { 0, 0, 0, 0 } }, |
| 53 |
+ { "format_resource", "{comment $0{hilight $1}($2)$4$3}", 5, { 0, 0, 0, 0, 0 } }, |
| 54 |
{ "format_resource_show", "($0)", 1, { 0 } }, |
| 55 |
{ "format_resource_status", ": $0", 1, { 0 } }, |
| 56 |
{ "format_subscription", "(subscription: $0)", 1, { 0 } }, |
| 57 |
+ { "format_pgp_keyid", "(pgp: $0)", 1, { 0 } }, |
| 58 |
|
| 59 |
/* ---- */ |
| 60 |
{ NULL, "Presence", 0, { 0 } }, |
| 61 |
--- a/src/fe-common/module-formats.h |
| 62 |
+++ b/src/fe-common/module-formats.h |
| 63 |
@@ -11,6 +11,7 @@ |
| 64 |
XMPPTXT_FORMAT_RESOURCE_SHOW, |
| 65 |
XMPPTXT_FORMAT_RESOURCE_STATUS, |
| 66 |
XMPPTXT_FORMAT_SUBSCRIPTION, |
| 67 |
+ XMPPTXT_FORMAT_PGP_KEYID, |
| 68 |
|
| 69 |
XMPPTXT_FILL_2, |
| 70 |
|