Check first if the QUOTA extension is available.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40979 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
2e20611a4f
commit
dd64744e69
@ -10,7 +10,7 @@
|
||||
|
||||
IMAPFolders::IMAPFolders()
|
||||
{
|
||||
|
||||
fHandlerList.AddItem(&fCapabilityHandler);
|
||||
}
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@ IMAPFolders::IMAPFolders(IMAPProtocol& connection)
|
||||
:
|
||||
IMAPProtocol(connection)
|
||||
{
|
||||
|
||||
fHandlerList.AddItem(&fCapabilityHandler);
|
||||
}
|
||||
|
||||
|
||||
@ -88,6 +88,11 @@ IMAPFolders::UnsubscribeFolder(const char* folder)
|
||||
status_t
|
||||
IMAPFolders::GetQuota(double& used, double& total)
|
||||
{
|
||||
if (fCapabilityHandler.Capabilities() == "")
|
||||
ProcessCommand(fCapabilityHandler.Command());
|
||||
if (fCapabilityHandler.Capabilities().FindFirst("QUOTA") < 0)
|
||||
return B_ERROR;
|
||||
|
||||
GetQuotaCommand quotaCommand;
|
||||
status_t status = ProcessCommand("aCommand);
|
||||
if (status != B_OK)
|
||||
|
@ -43,6 +43,8 @@ public:
|
||||
private:
|
||||
status_t _GetAllFolders(StringList& folders);
|
||||
status_t _GetSubscribedFolders(StringList& folders);
|
||||
|
||||
CapabilityHandler fCapabilityHandler;
|
||||
};
|
||||
|
||||
|
||||
|
@ -105,10 +105,8 @@ MailboxSelectHandler::Handle(const BString& response)
|
||||
}
|
||||
|
||||
|
||||
CapabilityHandler::CapabilityHandler(IMAPMailbox& mailbox)
|
||||
CapabilityHandler::CapabilityHandler()
|
||||
:
|
||||
IMAPMailboxCommand(mailbox),
|
||||
|
||||
fCapabilities("")
|
||||
{
|
||||
|
||||
|
@ -59,9 +59,9 @@ private:
|
||||
};
|
||||
|
||||
|
||||
class CapabilityHandler : public IMAPMailboxCommand {
|
||||
class CapabilityHandler : public IMAPCommand {
|
||||
public:
|
||||
CapabilityHandler(IMAPMailbox& mailbox);
|
||||
CapabilityHandler();
|
||||
|
||||
BString Command();
|
||||
bool Handle(const BString& response);
|
||||
|
@ -33,7 +33,6 @@ IMAPMailbox::IMAPMailbox(IMAPStorage& storage)
|
||||
fStorage(storage),
|
||||
|
||||
fMailboxSelectHandler(*this),
|
||||
fCapabilityHandler(*this),
|
||||
fExistsHandler(*this),
|
||||
fExpungeHandler(*this),
|
||||
fFlagsHandler(*this),
|
||||
|
Loading…
x
Reference in New Issue
Block a user