aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/pop3
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/pop3')
-rw-r--r--src/net/pop3/POP3Folder.cpp18
-rw-r--r--src/net/pop3/POP3Message.cpp18
2 files changed, 18 insertions, 18 deletions
diff --git a/src/net/pop3/POP3Folder.cpp b/src/net/pop3/POP3Folder.cpp
index 6a652de0..ffff121e 100644
--- a/src/net/pop3/POP3Folder.cpp
+++ b/src/net/pop3/POP3Folder.cpp
@@ -308,7 +308,7 @@ std::vector <ref <folder> > POP3Folder::getFolders(const bool /* recursive */)
}
-void POP3Folder::fetchMessages(std::vector <ref <message> >& msg, const int options,
+void POP3Folder::fetchMessages(std::vector <ref <message> >& msg, const fetchAttributes& options,
utility::progressListener* progress)
{
ref <POP3Store> store = m_store.acquire();
@@ -334,7 +334,7 @@ void POP3Folder::fetchMessages(std::vector <ref <message> >& msg, const int opti
progress->progress(++current, total);
}
- if (options & FETCH_SIZE)
+ if (options.has(fetchAttributes::SIZE))
{
// Send the "LIST" command
POP3Command::LIST()->send(store->getConnection());
@@ -374,7 +374,7 @@ void POP3Folder::fetchMessages(std::vector <ref <message> >& msg, const int opti
}
- if (options & FETCH_UID)
+ if (options.has(fetchAttributes::UID))
{
// Send the "UIDL" command
POP3Command::UIDL()->send(store->getConnection());
@@ -411,7 +411,7 @@ void POP3Folder::fetchMessages(std::vector <ref <message> >& msg, const int opti
}
-void POP3Folder::fetchMessage(ref <message> msg, const int options)
+void POP3Folder::fetchMessage(ref <message> msg, const fetchAttributes& options)
{
ref <POP3Store> store = m_store.acquire();
@@ -423,7 +423,7 @@ void POP3Folder::fetchMessage(ref <message> msg, const int options)
msg.dynamicCast <POP3Message>()->fetch
(thisRef().dynamicCast <POP3Folder>(), options);
- if (options & FETCH_SIZE)
+ if (options.has(fetchAttributes::SIZE))
{
// Send the "LIST" command
POP3Command::LIST(msg->getNumber())->send(store->getConnection());
@@ -456,7 +456,7 @@ void POP3Folder::fetchMessage(ref <message> msg, const int options)
}
}
- if (options & FETCH_UID)
+ if (options.has(fetchAttributes::UID))
{
// Send the "UIDL" command
POP3Command::UIDL(msg->getNumber())->send(store->getConnection());
@@ -489,9 +489,9 @@ void POP3Folder::fetchMessage(ref <message> msg, const int options)
int POP3Folder::getFetchCapabilities() const
{
- return (FETCH_ENVELOPE | FETCH_CONTENT_INFO |
- FETCH_SIZE | FETCH_FULL_HEADER | FETCH_UID |
- FETCH_IMPORTANCE);
+ return fetchAttributes::ENVELOPE | fetchAttributes::CONTENT_INFO |
+ fetchAttributes::SIZE | fetchAttributes::FULL_HEADER |
+ fetchAttributes::UID | fetchAttributes::IMPORTANCE;
}
diff --git a/src/net/pop3/POP3Message.cpp b/src/net/pop3/POP3Message.cpp
index 5b883e15..bad25cb9 100644
--- a/src/net/pop3/POP3Message.cpp
+++ b/src/net/pop3/POP3Message.cpp
@@ -172,28 +172,28 @@ void POP3Message::fetchPartHeader(ref <messagePart> /* p */)
}
-void POP3Message::fetch(ref <POP3Folder> msgFolder, const int options)
+void POP3Message::fetch(ref <POP3Folder> msgFolder, const fetchAttributes& options)
{
ref <POP3Folder> folder = m_folder.acquire();
if (folder != msgFolder)
throw exceptions::folder_not_found();
- // FETCH_STRUCTURE and FETCH_FLAGS are not supported by POP3.
- if (options & (folder::FETCH_STRUCTURE | folder::FETCH_FLAGS))
+ // STRUCTURE and FLAGS attributes are not supported by POP3
+ if (options.has(fetchAttributes::STRUCTURE | fetchAttributes::FLAGS))
throw exceptions::operation_not_supported();
// Check for the real need to fetch the full header
static const int optionsRequiringHeader =
- folder::FETCH_ENVELOPE | folder::FETCH_CONTENT_INFO |
- folder::FETCH_FULL_HEADER | folder::FETCH_IMPORTANCE;
+ fetchAttributes::ENVELOPE | fetchAttributes::CONTENT_INFO |
+ fetchAttributes::FULL_HEADER | fetchAttributes::IMPORTANCE;
- if (!(options & optionsRequiringHeader))
+ if (!options.has(optionsRequiringHeader))
return;
- // No need to differenciate between FETCH_ENVELOPE,
- // FETCH_CONTENT_INFO, ... since POP3 only permits to
- // retrieve the whole header and not fields in particular.
+ // No need to differenciate between ENVELOPE, CONTENT_INFO, ...
+ // since POP3 only permits to retrieve the whole header and not
+ // fields in particular.
// Emit the "TOP" command
ref <POP3Store> store = folder->m_store.acquire();