X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=imap%2Fmessage.c;h=3c5011c10e018cb10e1d56da9247358f459c88f5;hb=777c7ccc259a8b7f5fadac70267c59e62a2cb300;hp=75089b7f23efbd4299d5bc3a14ff8ddf6135ee22;hpb=ad29f4688c8a43e718f4cf25ab9337459fc472de;p=apps%2Fmadmutt.git diff --git a/imap/message.c b/imap/message.c index 75089b7..3c5011c 100644 --- a/imap/message.c +++ b/imap/message.c @@ -19,7 +19,10 @@ /* message parsing/updating functions */ -#include +#if HAVE_CONFIG_H +# include "config.h" +#endif + #include #include @@ -33,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); @@ -553,7 +562,13 @@ 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 (%s%s%s%s%s) {%lu}", mbox, + msg->flags.read ? "\\Seen" : "", + msg->flags.read && (msg->flags.replied || msg->flags.flagged) ? " " : "", + msg->flags.replied ? "\\Answered" : "", + msg->flags.replied && msg->flags.flagged ? " " : "", + msg->flags.flagged ? "\\Flagged" : "", + (unsigned long) len); imap_cmd_start (idata, buf);