Added support for DRAFT flag.

This commit is contained in:
Vincent Richard 2010-10-19 13:28:43 +00:00
parent dbcb03893c
commit fa06cf1652
5 changed files with 9 additions and 1 deletions

View File

@ -20,6 +20,7 @@ VMIME CONTRIBUTORS
- Pierre Thierry <nowhere.man@levallois.eu.org> (patches for STL algorithms)
- Zarafa <http://developer.zarafa.com/VmimePatches>
- Bartek Szurgot <vempirelord@wp.pl, http://baszerr.org>
- Achim Brändt <http://sourceforge.net/users/a-brandt/>
Please apologize if I have forgotten someone here. ;)
See SVN Changelog for full list.

View File

@ -555,6 +555,7 @@ void IMAPMessage::setFlags(const int flags, const int mode)
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())
{

View File

@ -419,10 +419,12 @@ int IMAPUtils::messageFlagsFromFlags(const IMAPParser::flag_list* list)
case IMAPParser::flag::SEEN:
flags |= message::FLAG_SEEN;
break;
case IMAPParser::flag::DRAFT:
flags |= message::FLAG_DRAFT;
break;
default:
//case IMAPParser::flag::UNKNOWN:
//case IMAPParser::flag::DRAFT:
break;
}
}
@ -439,6 +441,7 @@ const string IMAPUtils::messageFlagList(const int flags)
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())
{

View File

@ -102,6 +102,7 @@ int maildirUtils::extractFlags(const utility::file::path::component& comp)
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 @@ const utility::file::path::component maildirUtils::buildFlags(const int flags)
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));
}

View File

@ -227,6 +227,7 @@ public:
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). */