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:
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
IMAPFolders::IMAPFolders()
|
IMAPFolders::IMAPFolders()
|
||||||
{
|
{
|
||||||
|
fHandlerList.AddItem(&fCapabilityHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ IMAPFolders::IMAPFolders(IMAPProtocol& connection)
|
|||||||
:
|
:
|
||||||
IMAPProtocol(connection)
|
IMAPProtocol(connection)
|
||||||
{
|
{
|
||||||
|
fHandlerList.AddItem(&fCapabilityHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -88,6 +88,11 @@ IMAPFolders::UnsubscribeFolder(const char* folder)
|
|||||||
status_t
|
status_t
|
||||||
IMAPFolders::GetQuota(double& used, double& total)
|
IMAPFolders::GetQuota(double& used, double& total)
|
||||||
{
|
{
|
||||||
|
if (fCapabilityHandler.Capabilities() == "")
|
||||||
|
ProcessCommand(fCapabilityHandler.Command());
|
||||||
|
if (fCapabilityHandler.Capabilities().FindFirst("QUOTA") < 0)
|
||||||
|
return B_ERROR;
|
||||||
|
|
||||||
GetQuotaCommand quotaCommand;
|
GetQuotaCommand quotaCommand;
|
||||||
status_t status = ProcessCommand("aCommand);
|
status_t status = ProcessCommand("aCommand);
|
||||||
if (status != B_OK)
|
if (status != B_OK)
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ public:
|
|||||||
private:
|
private:
|
||||||
status_t _GetAllFolders(StringList& folders);
|
status_t _GetAllFolders(StringList& folders);
|
||||||
status_t _GetSubscribedFolders(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("")
|
fCapabilities("")
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@@ -59,9 +59,9 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class CapabilityHandler : public IMAPMailboxCommand {
|
class CapabilityHandler : public IMAPCommand {
|
||||||
public:
|
public:
|
||||||
CapabilityHandler(IMAPMailbox& mailbox);
|
CapabilityHandler();
|
||||||
|
|
||||||
BString Command();
|
BString Command();
|
||||||
bool Handle(const BString& response);
|
bool Handle(const BString& response);
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ IMAPMailbox::IMAPMailbox(IMAPStorage& storage)
|
|||||||
fStorage(storage),
|
fStorage(storage),
|
||||||
|
|
||||||
fMailboxSelectHandler(*this),
|
fMailboxSelectHandler(*this),
|
||||||
fCapabilityHandler(*this),
|
|
||||||
fExistsHandler(*this),
|
fExistsHandler(*this),
|
||||||
fExpungeHandler(*this),
|
fExpungeHandler(*this),
|
||||||
fFlagsHandler(*this),
|
fFlagsHandler(*this),
|
||||||
|
|||||||
Reference in New Issue
Block a user