Mercurial > hg
comparison mcabber/src/commands.c @ 1043:ebbde723614b
Store contacts PGP keys
Contacts PGP keys are retrieved from presence/message signatures;
they're displayed with /info.
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sun, 26 Nov 2006 17:08:21 +0100 |
parents | f9e8fd9cb58b |
children | ea71d31a2607 |
comparison
equal
deleted
inserted
replaced
1042:8a395c2cafc4 | 1043:ebbde723614b |
---|---|
1300 for ( ; resources ; resources = g_slist_next(resources) ) { | 1300 for ( ; resources ; resources = g_slist_next(resources) ) { |
1301 gchar rprio; | 1301 gchar rprio; |
1302 enum imstatus rstatus; | 1302 enum imstatus rstatus; |
1303 const char *rst_msg; | 1303 const char *rst_msg; |
1304 time_t rst_time; | 1304 time_t rst_time; |
1305 struct pgp_data *rpgp; | |
1305 | 1306 |
1306 rprio = buddy_getresourceprio(bud, resources->data); | 1307 rprio = buddy_getresourceprio(bud, resources->data); |
1307 rstatus = buddy_getstatus(bud, resources->data); | 1308 rstatus = buddy_getstatus(bud, resources->data); |
1308 rst_msg = buddy_getstatusmsg(bud, resources->data); | 1309 rst_msg = buddy_getstatusmsg(bud, resources->data); |
1309 rst_time = buddy_getstatustime(bud, resources->data); | 1310 rst_time = buddy_getstatustime(bud, resources->data); |
1311 rpgp = buddy_resource_pgp(bud, resources->data); | |
1310 | 1312 |
1311 snprintf(buffer, 4095, "Resource: [%c] (%d) %s", imstatus2char[rstatus], | 1313 snprintf(buffer, 4095, "Resource: [%c] (%d) %s", imstatus2char[rstatus], |
1312 rprio, (char*)resources->data); | 1314 rprio, (char*)resources->data); |
1313 scr_WriteIncomingMessage(jid, buffer, 0, HBB_PREFIX_INFO); | 1315 scr_WriteIncomingMessage(jid, buffer, 0, HBB_PREFIX_INFO); |
1314 if (rst_msg) { | 1316 if (rst_msg) { |
1320 | 1322 |
1321 strftime(tbuf, sizeof(tbuf), "%Y-%m-%d %H:%M:%S", localtime(&rst_time)); | 1323 strftime(tbuf, sizeof(tbuf), "%Y-%m-%d %H:%M:%S", localtime(&rst_time)); |
1322 snprintf(buffer, 127, "Status timestamp: %s", tbuf); | 1324 snprintf(buffer, 127, "Status timestamp: %s", tbuf); |
1323 scr_WriteIncomingMessage(jid, buffer, 0, HBB_PREFIX_NONE); | 1325 scr_WriteIncomingMessage(jid, buffer, 0, HBB_PREFIX_NONE); |
1324 } | 1326 } |
1327 #ifdef HAVE_GPGME | |
1328 if (rpgp && rpgp->sign_keyid) { | |
1329 snprintf(buffer, 4095, "PGP key id: %s", rpgp->sign_keyid); | |
1330 scr_WriteIncomingMessage(jid, buffer, 0, HBB_PREFIX_NONE); | |
1331 if (rpgp->last_sigsum) { | |
1332 gpgme_sigsum_t ss = rpgp->last_sigsum; | |
1333 snprintf(buffer, 4095, "Last PGP signature: %s", | |
1334 (ss & GPGME_SIGSUM_GREEN ? "good": | |
1335 (ss & GPGME_SIGSUM_RED ? "bad" : "unknown"))); | |
1336 scr_WriteIncomingMessage(jid, buffer, 0, HBB_PREFIX_NONE); | |
1337 } | |
1338 } | |
1339 #endif | |
1325 } | 1340 } |
1326 } else { | 1341 } else { |
1327 if (name) scr_LogPrint(LPRINT_NORMAL, "Name: %s", name); | 1342 if (name) scr_LogPrint(LPRINT_NORMAL, "Name: %s", name); |
1328 scr_LogPrint(LPRINT_NORMAL, "Type: %s", | 1343 scr_LogPrint(LPRINT_NORMAL, "Type: %s", |
1329 type == ROSTER_TYPE_GROUP ? "group" : | 1344 type == ROSTER_TYPE_GROUP ? "group" : |