Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

It is not possible to set a DRAFT flag.

A. Brandt
2010-10-19
2013-04-25
  • A. Brandt
    A. Brandt
    2010-10-19

    So made this patch:

    Index: src/net/maildir/maildirUtils.cpp

    -- src/net/maildir/maildirUtils.cpp (revision 569)
    +++ src/net/maildir/maildirUtils.cpp (working copy)
    @@ -102,6 +102,7 @@
    case 'T': case 't': flags |= message::FLAG_DELETED; break;
    case 'F': case 'f': flags |= message::FLAG_MARKED; break;
    case 'P': case 'p': flags |= message::FLAG_PASSED; break;
    + case 'D': case 'd': flags |= message::FLAG_DRAFT; break;
    }
    }

    @@ -121,6 +122,7 @@
    if (flags & message::FLAG_REPLIED) str += "R";
    if (flags & message::FLAG_SEEN)    str += "S";
    if (flags & message::FLAG_DELETED) str += "T";
    + if (flags & message::FLAG_DRAFT)   str += "D";

    return (utility::file::path::component(str));
    }
    Index: src/net/imap/IMAPUtils.cpp
    ===================================================================
    -- src/net/imap/IMAPUtils.cpp (revision 569)
    +++ src/net/imap/IMAPUtils.cpp (working copy)
    @@ -419,6 +419,9 @@
    case IMAPParser::flag::SEEN:
    flags |= message::FLAG_SEEN;
    break;
    + case IMAPParser::flag::DRAFT:
    + flags |= message::FLAG_DRAFT;
    + break;

    default:
    //case IMAPParser::flag::UNKNOWN:
    @@ -439,6 +442,7 @@
    if (flags & message::FLAG_MARKED) flagList.push_back("\\Flagged");
    if (flags & message::FLAG_DELETED) flagList.push_back("\\Deleted");
    if (flags & message::FLAG_SEEN) flagList.push_back("\\Seen");
    + if (flags & message::FLAG_DRAFT) flagList.push_back("\\Draft");

    if (!flagList.empty())
    {
    Index: src/net/imap/IMAPMessage.cpp
    ===================================================================
    -- src/net/imap/IMAPMessage.cpp (revision 569)
    +++ src/net/imap/IMAPMessage.cpp (working copy)
    @@ -555,6 +555,7 @@
    if (flags & FLAG_MARKED) flagList.push_back("\\Flagged");
    if (flags & FLAG_DELETED) flagList.push_back("\\Deleted");
    if (flags & FLAG_SEEN) flagList.push_back("\\Seen");
    + if (flags & FLAG_DRAFT) flagList.push_back("\\Draft");

    if (!flagList.empty())
    {
    Index: vmime/net/message.hpp
    ===================================================================
    -- vmime/net/message.hpp (revision 569)
    +++ vmime/net/message.hpp (working copy)
    @@ -227,6 +227,7 @@
    FLAG_REPLIED = (1 << 3),   /**< User replied to this message. */
    FLAG_MARKED  = (1 << 4),   /**< Used-defined flag. */
    FLAG_PASSED  = (1 << 5),   /**< Message has been resent/forwarded/bounced. */
    + FLAG_DRAFT   = (1 << 6),   /**< Message is marked as a 'draft'. */

    FLAG_UNDEFINED = 9999      /**< Used internally (this should not be returned
                                    by the flags() function). */

     
  • Hello!

    Thank you for this patch, I committed it.

    Vincent