Reset status view when fetch failed.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40752 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
9a73627a81
commit
8e4e1a2880
@ -61,6 +61,13 @@ DispatcherIMAPListener::NewMessagesToFetch(int32 nMessages)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DispatcherIMAPListener::FetchEnd()
|
||||
{
|
||||
fProtocol.ResetProgress();
|
||||
}
|
||||
|
||||
|
||||
const uint32 kMsgStartWatching = '&StW';
|
||||
|
||||
|
||||
|
@ -31,6 +31,7 @@ public:
|
||||
void BodyFetched(int32 uid, BPositionIO* data);
|
||||
|
||||
void NewMessagesToFetch(int32 nMessages);
|
||||
void FetchEnd();
|
||||
private:
|
||||
MailProtocol& fProtocol;
|
||||
IMAPStorage& fStorage;
|
||||
|
@ -306,7 +306,7 @@ FetchMessageCommand::FetchMessageCommand(IMAPMailbox& mailbox, int32 message,
|
||||
fOutData(data),
|
||||
fFetchBodyLimit(fetchBodyLimit)
|
||||
{
|
||||
|
||||
fIMAPMailbox.Listener().NewMessagesToFetch(fEndMessage - fMessage + 1);
|
||||
}
|
||||
|
||||
|
||||
@ -320,7 +320,13 @@ FetchMessageCommand::FetchMessageCommand(IMAPMailbox& mailbox,
|
||||
fOutData(NULL),
|
||||
fFetchBodyLimit(fetchBodyLimit)
|
||||
{
|
||||
|
||||
fIMAPMailbox.Listener().NewMessagesToFetch(fEndMessage - fMessage + 1);
|
||||
}
|
||||
|
||||
|
||||
FetchMessageCommand::~FetchMessageCommand()
|
||||
{
|
||||
fIMAPMailbox.Listener().FetchEnd();
|
||||
}
|
||||
|
||||
|
||||
@ -478,6 +484,8 @@ FetchBodyCommand::Handle(const BString& response)
|
||||
int32 uid = fIMAPMailbox.MessageNumberToUID(message);
|
||||
if (uid >= 0)
|
||||
fIMAPMailbox.Listener().BodyFetched(uid, fOutData);
|
||||
else
|
||||
fIMAPMailbox.Listener().FetchEnd();
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -615,8 +623,6 @@ ExistsHandler::Handle(const BString& response)
|
||||
nMessages + 1, exists, &list, NULL);
|
||||
fIMAPMailbox.AddAfterQuakeCommand(command);
|
||||
|
||||
fIMAPMailbox.Listener().NewMessagesToFetch(exists - nMessages);
|
||||
|
||||
command = new FetchMessageCommand(fIMAPMailbox, nMessages + 1, exists,
|
||||
fIMAPMailbox.FetchBodyLimit());
|
||||
fIMAPMailbox.AddAfterQuakeCommand(command);
|
||||
|
@ -130,6 +130,7 @@ public:
|
||||
FetchMessageCommand(IMAPMailbox& mailbox,
|
||||
int32 firstMessage, int32 lastMessage,
|
||||
int32 fetchBodyLimit = -1);
|
||||
~FetchMessageCommand();
|
||||
|
||||
BString Command();
|
||||
bool Handle(const BString& response);
|
||||
|
@ -22,6 +22,7 @@ public:
|
||||
virtual void BodyFetched(int32 uid, BPositionIO* data) {}
|
||||
|
||||
virtual void NewMessagesToFetch(int32 nMessages) {}
|
||||
virtual void FetchEnd() {}
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user