comparison mcabber/src/jabglue.c @ 1065:230dca34dbea

Extand pgp_data structure Extand pgp_data structure so that we can disbale PGP per contact and compare the signature key with a reference key id.
author Mikael Berthe <mikael@lilotux.net>
date Sat, 02 Dec 2006 11:13:40 +0100
parents c0d44a9a99bc
children a5dc85fdebde
comparison
equal deleted inserted replaced
1064:516b5f7d1023 1065:230dca34dbea
537 537
538 #if defined HAVE_GPGME || defined JEP0022 || defined JEP0085 538 #if defined HAVE_GPGME || defined JEP0022 || defined JEP0085
539 rname = strchr(fjid, JID_RESOURCE_SEPARATOR); 539 rname = strchr(fjid, JID_RESOURCE_SEPARATOR);
540 barejid = jidtodisp(fjid); 540 barejid = jidtodisp(fjid);
541 sl_buddy = roster_find(barejid, jidsearch, ROSTER_TYPE_USER); 541 sl_buddy = roster_find(barejid, jidsearch, ROSTER_TYPE_USER);
542 g_free(barejid);
543 542
544 // If we can get a resource name, we use it. Else we use NULL, 543 // If we can get a resource name, we use it. Else we use NULL,
545 // which hopefully will give us the most likely resource. 544 // which hopefully will give us the most likely resource.
546 if (rname) 545 if (rname)
547 rname++; 546 rname++;
548 #endif 547 #endif
549 548
550 #ifdef HAVE_GPGME 549 #ifdef HAVE_GPGME
551 if (type == ROSTER_TYPE_USER && sl_buddy && gpg_enabled()) { 550 if (type == ROSTER_TYPE_USER && sl_buddy && gpg_enabled()) {
552 struct pgp_data *res_pgpdata; 551 if (!settings_pgp_getdisabled(barejid)) { // disabled for this contact?
553 res_pgpdata = buddy_resource_pgp(sl_buddy->data, rname); 552 struct pgp_data *res_pgpdata;
554 if (res_pgpdata && res_pgpdata->sign_keyid) 553 res_pgpdata = buddy_resource_pgp(sl_buddy->data, rname);
555 enc = gpg_encrypt(text, res_pgpdata->sign_keyid); 554 if (res_pgpdata && res_pgpdata->sign_keyid)
556 } 555 enc = gpg_encrypt(text, res_pgpdata->sign_keyid);
556 }
557 }
558 #endif
559 #if defined HAVE_GPGME || defined JEP0022 || defined JEP0085
560 g_free(barejid);
557 #endif 561 #endif
558 562
559 x = jutil_msgnew(strtype, (char*)fjid, NULL, 563 x = jutil_msgnew(strtype, (char*)fjid, NULL,
560 (enc ? "This message is PGP-encrypted." : (char*)text)); 564 (enc ? "This message is PGP-encrypted." : (char*)text));
561 if (subject) { 565 if (subject) {