aboutsummaryrefslogtreecommitdiffstats
path: root/src/messaging/imap/IMAPMessage.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2005-07-25 11:08:34 +0000
committerVincent Richard <[email protected]>2005-07-25 11:08:34 +0000
commitbd925cef1c7a05394dcf518a7b103997324c3552 (patch)
tree191c0c790af1946d14fc933e015e3f6d566add87 /src/messaging/imap/IMAPMessage.cpp
parentDon't throw if no field is found, just return normal priority. (diff)
downloadvmime-bd925cef1c7a05394dcf518a7b103997324c3552.tar.gz
vmime-bd925cef1c7a05394dcf518a7b103997324c3552.zip
Added FETCH_IMPORTANCE flag.
Diffstat (limited to 'src/messaging/imap/IMAPMessage.cpp')
-rw-r--r--src/messaging/imap/IMAPMessage.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/messaging/imap/IMAPMessage.cpp b/src/messaging/imap/IMAPMessage.cpp
index bbda8386..ba77251b 100644
--- a/src/messaging/imap/IMAPMessage.cpp
+++ b/src/messaging/imap/IMAPMessage.cpp
@@ -492,8 +492,32 @@ void IMAPMessage::fetch(IMAPFolder* folder, const int options)
if (options & folder::FETCH_ENVELOPE)
items.push_back("ENVELOPE");
+ std::vector <string> headerFields;
+
if (options & folder::FETCH_CONTENT_INFO)
- items.push_back("BODY[HEADER.FIELDS (CONTENT-TYPE)]");
+ headerFields.push_back("CONTENT_TYPE");
+
+ if (options & folder::FETCH_IMPORTANCE)
+ {
+ headerFields.push_back("IMPORTANCE");
+ headerFields.push_back("X-PRIORITY");
+ }
+
+ if (!headerFields.empty())
+ {
+ string list;
+
+ for (std::vector <string>::iterator it = headerFields.begin() ;
+ it != headerFields.end() ; ++it)
+ {
+ if (it != headerFields.begin())
+ list += " ";
+
+ list += *it;
+ }
+
+ items.push_back("BODY[HEADER.FIELDS (" + list + ")]");
+ }
}
// Build the request text