Package: irssi-plugin-xmpp / 0.54-3

singpolyma-0006-Display-verified-keyID-in-roster.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
From 9647768f6caf2180026c0206be2476ccc77eaccf Mon Sep 17 00:00:00 2001
From: Stephen Paul Weber <singpolyma@singpolyma.net>
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
@@ -65,7 +65,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;
@@ -82,9 +82,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);
@@ -144,7 +147,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, "Roster", 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,