Fixed getMessages().
This commit is contained in:
parent
de2431dd0c
commit
81b7b009e9
@ -2,6 +2,11 @@
|
||||
VERSION 0.7.2cvs
|
||||
================
|
||||
|
||||
2005-07-23 Vincent Richard <vincent@vincent-richard.net>
|
||||
|
||||
* POP3, IMAP, maildir: fixed getMessages() when default arguments are given:
|
||||
no message were returned, instead of the real message count.
|
||||
|
||||
2005-07-15 Vincent Richard <vincent@vincent-richard.net>
|
||||
|
||||
* *attachment, messageParser: added a getName() parameter to retrieve
|
||||
|
@ -464,12 +464,17 @@ ref <message> IMAPFolder::getMessage(const int num)
|
||||
|
||||
std::vector <ref <message> > IMAPFolder::getMessages(const int from, const int to)
|
||||
{
|
||||
const int messageCount = getMessageCount();
|
||||
const int to2 = (to == -1 ? messageCount : to);
|
||||
|
||||
if (!isOpen())
|
||||
throw exceptions::illegal_state("Folder not open");
|
||||
else if (to2 < from || from < 1 || to2 < 1 || from > messageCount || to2 > messageCount)
|
||||
throw exceptions::message_not_found();
|
||||
|
||||
std::vector <ref <message> > v;
|
||||
|
||||
for (int i = from ; i <= to ; ++i)
|
||||
for (int i = from ; i <= to2 ; ++i)
|
||||
v.push_back(vmime::create <IMAPMessage>(this, i));
|
||||
|
||||
return (v);
|
||||
|
@ -405,12 +405,16 @@ ref <message> maildirFolder::getMessage(const int num)
|
||||
|
||||
std::vector <ref <message> > maildirFolder::getMessages(const int from, const int to)
|
||||
{
|
||||
const int to2 = (to == -1 ? m_messageCount : to);
|
||||
|
||||
if (!isOpen())
|
||||
throw exceptions::illegal_state("Folder not open");
|
||||
else if (to2 < from || from < 1 || to2 < 1 || from > m_messageCount || to2 > m_messageCount)
|
||||
throw exceptions::message_not_found();
|
||||
|
||||
std::vector <ref <message> > v;
|
||||
|
||||
for (int i = from ; i <= to ; ++i)
|
||||
for (int i = from ; i <= to2 ; ++i)
|
||||
{
|
||||
v.push_back(vmime::create <maildirMessage>
|
||||
(thisWeakRef().dynamicCast <maildirFolder>(), i));
|
||||
|
@ -206,16 +206,18 @@ ref <message> POP3Folder::getMessage(const int num)
|
||||
|
||||
std::vector <ref <message> > POP3Folder::getMessages(const int from, const int to)
|
||||
{
|
||||
const int to2 = (to == -1 ? m_messageCount : to);
|
||||
|
||||
if (!m_store)
|
||||
throw exceptions::illegal_state("Store disconnected");
|
||||
else if (!isOpen())
|
||||
throw exceptions::illegal_state("Folder not open");
|
||||
else if (to < from || from < 1 || to < 1 || from > m_messageCount || to > m_messageCount)
|
||||
else if (to2 < from || from < 1 || to2 < 1 || from > m_messageCount || to2 > m_messageCount)
|
||||
throw exceptions::message_not_found();
|
||||
|
||||
std::vector <ref <message> > v;
|
||||
|
||||
for (int i = from ; i <= to ; ++i)
|
||||
for (int i = from ; i <= to2 ; ++i)
|
||||
v.push_back(vmime::create <POP3Message>(this, i));
|
||||
|
||||
return (v);
|
||||
|
Loading…
Reference in New Issue
Block a user