From 31b2a458ff66a70fffe587448d60044b7127b795 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Tue, 26 Feb 2002 23:39:58 +0000 Subject: doc/ 2002-02-27 Marcus Brinkmann * gpgme.texi (Encrypting a Plaintext): Document GPGME_Invalid_Recipients. (Error Values): Likewise. gpgme/ 2002-02-27 Marcus Brinkmann * gpgme.h: Add new error code GPGME_Invalid_Recipient. * encrypt.c (struct encrypt_result_s): New member invalid_recipients, rename no_recipients to no_valid_recipients. (_gpgme_encrypt_status_handler): Include error for invalid recipients. * engine-gpgsm.c (gpgsm_set_recipients): Change type of first argument to GpgsmObject. Use that to report back the status about the recipients. --- gpgme/encrypt.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'gpgme/encrypt.c') diff --git a/gpgme/encrypt.c b/gpgme/encrypt.c index 2f6abdae..ffaf2d90 100644 --- a/gpgme/encrypt.c +++ b/gpgme/encrypt.c @@ -38,7 +38,8 @@ struct encrypt_result_s { - int no_recipients; + int no_valid_recipients; + int invalid_recipients; GpgmeData xmlinfo; }; @@ -113,16 +114,19 @@ _gpgme_encrypt_status_handler (GpgmeCtx ctx, GpgStatusCode code, char *args) _gpgme_set_op_info (ctx, ctx->result.encrypt->xmlinfo); ctx->result.encrypt->xmlinfo = NULL; } - if (ctx->result.encrypt->no_recipients) + if (ctx->result.encrypt->no_valid_recipients) ctx->error = mk_error (No_Recipients); + else if (ctx->result.encrypt->invalid_recipients) + ctx->error = mk_error (Invalid_Recipients); break; case STATUS_INV_RECP: + ctx->result.encrypt->invalid_recipients++; append_xml_encinfo (&ctx->result.encrypt->xmlinfo, args); break; case STATUS_NO_RECP: - ctx->result.encrypt->no_recipients = 1; /* i.e. no usable ones */ + ctx->result.encrypt->no_valid_recipients = 1; break; default: -- cgit v1.2.3