diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/messaging/imap/IMAPFolder.cpp | 3 | ||||
-rw-r--r-- | src/messaging/imap/IMAPMessage.cpp | 26 | ||||
-rw-r--r-- | src/messaging/maildir/maildirFolder.cpp | 3 | ||||
-rw-r--r-- | src/messaging/maildir/maildirMessage.cpp | 6 | ||||
-rw-r--r-- | src/messaging/pop3/POP3Folder.cpp | 3 | ||||
-rw-r--r-- | src/messaging/pop3/POP3Message.cpp | 10 |
6 files changed, 40 insertions, 11 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 diff --git a/src/messaging/maildir/maildirFolder.cpp b/src/messaging/maildir/maildirFolder.cpp index ebb0dd29..e7a4e2f8 100644 --- a/src/messaging/maildir/maildirFolder.cpp +++ b/src/messaging/maildir/maildirFolder.cpp @@ -1368,7 +1368,8 @@ void maildirFolder::fetchMessage(ref <message> msg, const int options) const int maildirFolder::getFetchCapabilities() const { return (FETCH_ENVELOPE | FETCH_STRUCTURE | FETCH_CONTENT_INFO | - 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/maildir/maildirMessage.cpp b/src/messaging/maildir/maildirMessage.cpp index daaa2784..e2393774 100644 --- a/src/messaging/maildir/maildirMessage.cpp +++ b/src/messaging/maildir/maildirMessage.cpp @@ -421,7 +421,8 @@ void maildirMessage::fetch(weak_ref <maildirFolder> folder, const int options) m_uid = maildirUtils::extractId(path.getLastComponent()).getBuffer(); if (options & (folder::FETCH_ENVELOPE | folder::FETCH_CONTENT_INFO | - folder::FETCH_FULL_HEADER | folder::FETCH_STRUCTURE)) + folder::FETCH_FULL_HEADER | folder::FETCH_STRUCTURE | + folder::FETCH_IMPORTANCE)) { string contents; @@ -481,7 +482,8 @@ void maildirMessage::fetch(weak_ref <maildirFolder> folder, const int options) // Extract some header fields or whole header if (options & (folder::FETCH_ENVELOPE | folder::FETCH_CONTENT_INFO | - folder::FETCH_FULL_HEADER)) + folder::FETCH_FULL_HEADER | + folder::FETCH_IMPORTANCE)) { getOrCreateHeader()->copyFrom(*(msg.getHeader())); } diff --git a/src/messaging/pop3/POP3Folder.cpp b/src/messaging/pop3/POP3Folder.cpp index 0afd3589..ec2c9d52 100644 --- a/src/messaging/pop3/POP3Folder.cpp +++ b/src/messaging/pop3/POP3Folder.cpp @@ -476,7 +476,8 @@ void POP3Folder::fetchMessage(ref <message> msg, const int options) const int POP3Folder::getFetchCapabilities() const { return (FETCH_ENVELOPE | FETCH_CONTENT_INFO | - FETCH_SIZE | FETCH_FULL_HEADER | FETCH_UID); + FETCH_SIZE | FETCH_FULL_HEADER | FETCH_UID | + FETCH_IMPORTANCE); } diff --git a/src/messaging/pop3/POP3Message.cpp b/src/messaging/pop3/POP3Message.cpp index 7b848f87..ed8999e3 100644 --- a/src/messaging/pop3/POP3Message.cpp +++ b/src/messaging/pop3/POP3Message.cpp @@ -170,12 +170,12 @@ void POP3Message::fetch(POP3Folder* folder, const int options) throw exceptions::operation_not_supported(); // Check for the real need to fetch the full header - if (!((options & folder::FETCH_ENVELOPE) || - (options & folder::FETCH_CONTENT_INFO) || - (options & folder::FETCH_FULL_HEADER))) - { + static const int optionsRequiringHeader = + folder::FETCH_ENVELOPE | folder::FETCH_CONTENT_INFO | + folder::FETCH_FULL_HEADER | folder::FETCH_IMPORTANCE; + + if (!(options & optionsRequiringHeader)) return; - } // No need to differenciate between FETCH_ENVELOPE, // FETCH_CONTENT_INFO, ... since POP3 only permits to |