diff options
Diffstat (limited to 'src/messaging/imap')
-rw-r--r-- | src/messaging/imap/IMAPFolder.cpp | 3 | ||||
-rw-r--r-- | src/messaging/imap/IMAPMessage.cpp | 26 |
2 files changed, 27 insertions, 2 deletions
diff --git a/src/messaging/imap/IMAPFolder.cpp b/src/messaging/imap/IMAPFolder.cpp index a63e8aa6..ca09fa47 100644 --- a/src/messaging/imap/IMAPFolder.cpp +++ b/src/messaging/imap/IMAPFolder.cpp @@ -643,7 +643,8 @@ void IMAPFolder::fetchMessage(ref <message> msg, const int options) const int IMAPFolder::getFetchCapabilities() const { return (FETCH_ENVELOPE | FETCH_CONTENT_INFO | FETCH_STRUCTURE | - FETCH_FLAGS | FETCH_SIZE | FETCH_FULL_HEADER | FETCH_UID); + FETCH_FLAGS | FETCH_SIZE | FETCH_FULL_HEADER | FETCH_UID | + FETCH_IMPORTANCE); } 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 |