PGP: Display whether contact public key was received or manually set

This commit is contained in:
James Booth
2015-08-25 23:04:21 +01:00
parent fc1ee79190
commit 55c2d1cc21
4 changed files with 42 additions and 13 deletions

View File

@@ -1157,8 +1157,8 @@ static struct cmd_t command_defs[] =
CMD_ARGS(
{ "libver", "Show which version of the libgpgme library is being used." },
{ "keys", "List all keys known to the system." },
{ "contacts", "Show contacts with assigned public keys." },
{ "setkey <contact> <keyid>", "Manually associate a key ID with a JID." },
{ "contacts", "Show contacts with assigned public keys." },
{ "setkey <contact> <keyid>", "Manually associate a contact with a public key." },
{ "start [<contact>]", "Start PGP encrypted chat, current contact will be used if not specified." },
{ "end", "End PGP encrypted chat with the current recipient." },
{ "log on|off", "Enable or disable plaintext logging of PGP encrypted messages." },

View File

@@ -4287,8 +4287,12 @@ cmd_pgp(ProfWin *window, const char * const command, gchar **args)
GList *curr = jids;
while (curr) {
char *jid = curr->data;
char *pubkey = g_hash_table_lookup(pubkeys, jid);
cons_show(" %s: %s", jid, pubkey);
ProfPGPPubKeyId *pubkeyid = g_hash_table_lookup(pubkeys, jid);
if (pubkeyid->received) {
cons_show(" %s: %s (received)", jid, pubkeyid->id);
} else {
cons_show(" %s: %s (stored)", jid, pubkeyid->id);
}
curr = g_list_next(curr);
}
g_list_free(jids);