X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=imap%2Fmessage.c;h=96d7e229af629885eb201fe502d862cc1f1c129d;hp=016487b1971770a96934334d0796eca2620cb843;hb=b1dfcb5c755ef8c2be60369432bc91e434b72a1f;hpb=3d937534e7b1ee723f86594b5e4c64c95158a933 diff --git a/imap/message.c b/imap/message.c index 016487b..96d7e22 100644 --- a/imap/message.c +++ b/imap/message.c @@ -19,6 +19,10 @@ /* message parsing/updating functions */ +#if HAVE_CONFIG_H +# include "config.h" +#endif + #include #include @@ -32,6 +36,12 @@ #include "pgp.h" #endif +#if HAVE_STDINT_H +#include +#elif HAVE_INTTYPES_H +#include +#endif + static void flush_buffer(char* buf, size_t* len, CONNECTION* conn); static int msg_fetch_header (CONTEXT* ctx, IMAP_HEADER* h, char* buf, FILE* fp); @@ -65,7 +75,7 @@ int imap_read_headers (IMAP_DATA* idata, int msgbegin, int msgend) #if USE_HCACHE void *hc = NULL; - unsigned long long *uid_validity = NULL; + uint64_t *uid_validity = NULL; char uid_buf[64]; #endif /* USE_HCACHE */ @@ -150,7 +160,7 @@ int imap_read_headers (IMAP_DATA* idata, int msgbegin, int msgend) fputs ("\n\n", fp); sprintf(uid_buf, "/%u", h.data->uid); /* XXX --tg 21:41 04-07-11 */ - uid_validity = (unsigned long long *) mutt_hcache_fetch (hc, uid_buf, &imap_hcache_keylen); + uid_validity = (uint64_t *) mutt_hcache_fetch (hc, uid_buf, &imap_hcache_keylen); if (uid_validity != NULL && *uid_validity == idata->uid_validity) { @@ -552,7 +562,10 @@ int imap_append_message (CONTEXT *ctx, MESSAGE *msg) rewind (fp); imap_munge_mbox_name (mbox, sizeof (mbox), mailbox); - snprintf (buf, sizeof (buf), "APPEND %s (\\Seen) {%lu}", mbox, len); + snprintf (buf, sizeof (buf), "APPEND %s (\\Seen%s%s) {%lu}", mbox, + msg->flags.replied ? " \\Answered" : "", + msg->flags.flagged ? " \\Flagged" : "", + (unsigned long) len); imap_cmd_start (idata, buf);