imap-send.c: remove some unused fields from struct store

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Michael Haggerty committed Jan 15, 2013 at 09:06 UTC 1efee7ffce56da48ac0cecfe2e66f0f6f2b15dd6
1 file changed +13 -12
imap-send.c
+13 -12
@@ -36,12 +36,7 @@ typedef void *SSL;
36 struct store {
37 /* currently open mailbox */
38 const char *name; /* foreign! maybe preset? */
39 - char *path; /* own */
39 int uidvalidity;
41 - unsigned char opts; /* maybe preset? */
42 - /* note that the following do _not_ reflect stats from msgs, but mailbox totals */
43 - int count; /* # of messages */
44 - int recent; /* # of recent messages - don't trust this beyond the initial read */
40 };
41
42 static const char imap_send_usage[] = "git imap-send < <mbox>";
@@ -772,13 +767,20 @@ static int get_cmd_result(struct imap_store *ctx, struct imap_cmd *tcmd)
767 !strcmp("NO", arg) || !strcmp("BYE", arg)) {
768 if ((resp = parse_response_code(ctx, NULL, cmd)) != RESP_OK)
769 return resp;
775 - } else if (!strcmp("CAPABILITY", arg))
770 + } else if (!strcmp("CAPABILITY", arg)) {
771 parse_capability(imap, cmd);
777 - else if ((arg1 = next_arg(&cmd))) {
778 - if (!strcmp("EXISTS", arg1))
779 - ctx->gen.count = atoi(arg);
780 - else if (!strcmp("RECENT", arg1))
781 - ctx->gen.recent = atoi(arg);
772 + } else if ((arg1 = next_arg(&cmd))) {
773 + ; /*
774 + * Unhandled response-data with at least two words.
775 + * Ignore it.
776 + *
777 + * NEEDSWORK: Previously this case handled '<num> EXISTS'
778 + * and '<num> RECENT' but as a probably-unintended side
779 + * effect it ignores other unrecognized two-word
780 + * responses. imap-send doesn't ever try to read
781 + * messages or mailboxes these days, so consider
782 + * eliminating this case.
783 + */
784 } else {
785 fprintf(stderr, "IMAP error: unable to parse untagged response\n");
786 return RESP_BAD;
@@ -1254,7 +1256,6 @@ static int imap_store_msg(struct store *gctx, struct strbuf *msg)
1256 imap->caps = imap->rcaps;
1257 if (ret != DRV_OK)
1258 return ret;
1257 - gctx->count++;
1259
1260 return DRV_OK;
1261 }