@@ -33,12 +33,6 @@ typedef void *SSL;
33
33
#include <openssl/hmac.h>
34
34
#endif
35
35
36
- struct store {
37
- /* currently open mailbox */
38
- const char * name ; /* foreign! maybe preset? */
39
- int uidvalidity ;
40
- };
41
-
42
36
static const char imap_send_usage [] = "git imap-send < <mbox>" ;
43
37
44
38
#undef DRV_OK
@@ -123,7 +117,9 @@ struct imap {
123
117
};
124
118
125
119
struct imap_store {
126
- struct store gen ;
120
+ /* currently open mailbox */
121
+ const char * name ; /* foreign! maybe preset? */
122
+ int uidvalidity ;
127
123
struct imap * imap ;
128
124
const char * prefix ;
129
125
};
@@ -618,7 +614,7 @@ static int parse_response_code(struct imap_store *ctx, struct imap_cmd_cb *cb,
618
614
* p ++ = 0 ;
619
615
arg = next_arg (& s );
620
616
if (!strcmp ("UIDVALIDITY" , arg )) {
621
- if (!(arg = next_arg (& s )) || !(ctx -> gen . uidvalidity = atoi (arg ))) {
617
+ if (!(arg = next_arg (& s )) || !(ctx -> uidvalidity = atoi (arg ))) {
622
618
fprintf (stderr , "IMAP error: malformed UIDVALIDITY status\n" );
623
619
return RESP_BAD ;
624
620
}
@@ -636,7 +632,7 @@ static int parse_response_code(struct imap_store *ctx, struct imap_cmd_cb *cb,
636
632
for (; isspace ((unsigned char )* p ); p ++ );
637
633
fprintf (stderr , "*** IMAP ALERT *** %s\n" , p );
638
634
} else if (cb && cb -> ctx && !strcmp ("APPENDUID" , arg )) {
639
- if (!(arg = next_arg (& s )) || !(ctx -> gen . uidvalidity = atoi (arg )) ||
635
+ if (!(arg = next_arg (& s )) || !(ctx -> uidvalidity = atoi (arg )) ||
640
636
!(arg = next_arg (& s )) || !(* (int * )cb -> ctx = atoi (arg ))) {
641
637
fprintf (stderr , "IMAP error: malformed APPENDUID status\n" );
642
638
return RESP_BAD ;
@@ -1150,7 +1146,7 @@ static int imap_store_msg(struct imap_store *ctx, struct strbuf *msg)
1150
1146
cb .dlen = msg -> len ;
1151
1147
cb .data = strbuf_detach (msg , NULL );
1152
1148
1153
- box = ctx -> gen . name ;
1149
+ box = ctx -> name ;
1154
1150
prefix = !strcmp (box , "INBOX" ) ? "" : ctx -> prefix ;
1155
1151
cb .create = 0 ;
1156
1152
ret = imap_exec_m (ctx , & cb , "APPEND \"%s%s\" " , prefix , box );
@@ -1362,7 +1358,7 @@ int main(int argc, char **argv)
1362
1358
}
1363
1359
1364
1360
fprintf (stderr , "sending %d message%s\n" , total , (total != 1 ) ? "s" : "" );
1365
- ctx -> gen . name = imap_folder ;
1361
+ ctx -> name = imap_folder ;
1366
1362
while (1 ) {
1367
1363
unsigned percent = n * 100 / total ;
1368
1364
0 commit comments