Use GETQUOTAROOT instead of GETQUOTA.
* At least with my ISP, there is no "" root, so the command would fail when used as is. * Now we always use the GETQUOTAROOT command instead, by default for the INBOX mailbox. This isn't entirely correct either, but better than nothing.
This commit is contained in:
@@ -740,7 +740,7 @@ GetQuotaCommand::GetQuotaCommand(const char* mailboxName)
|
|||||||
BString
|
BString
|
||||||
GetQuotaCommand::CommandString()
|
GetQuotaCommand::CommandString()
|
||||||
{
|
{
|
||||||
BString command = "GETQUOTA \"";
|
BString command = "GETQUOTAROOT \"";
|
||||||
command += fMailboxName;
|
command += fMailboxName;
|
||||||
command += "\"";
|
command += "\"";
|
||||||
return command;
|
return command;
|
||||||
@@ -750,12 +750,15 @@ GetQuotaCommand::CommandString()
|
|||||||
bool
|
bool
|
||||||
GetQuotaCommand::HandleUntagged(Response& response)
|
GetQuotaCommand::HandleUntagged(Response& response)
|
||||||
{
|
{
|
||||||
if (!response.IsCommand("QUOTA") || response.IsListAt(1))
|
if (!response.IsCommand("QUOTA") || !response.IsListAt(2))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const ArgumentList& arguments = response.ListAt(1);
|
const ArgumentList& arguments = response.ListAt(2);
|
||||||
fUsedStorage = (uint64)arguments.NumberAt(0) * 1024;
|
if (!arguments.EqualsAt(0, "STORAGE"))
|
||||||
fTotalStorage = (uint64)arguments.NumberAt(1) * 1024;
|
return false;
|
||||||
|
|
||||||
|
fUsedStorage = (uint64)arguments.NumberAt(1) * 1024;
|
||||||
|
fTotalStorage = (uint64)arguments.NumberAt(2) * 1024;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -289,7 +289,8 @@ private:
|
|||||||
|
|
||||||
class GetQuotaCommand : public Command, public Handler {
|
class GetQuotaCommand : public Command, public Handler {
|
||||||
public:
|
public:
|
||||||
GetQuotaCommand(const char* mailboxName = "");
|
GetQuotaCommand(
|
||||||
|
const char* mailboxName = "INBOX");
|
||||||
|
|
||||||
BString CommandString();
|
BString CommandString();
|
||||||
bool HandleUntagged(Response& response);
|
bool HandleUntagged(Response& response);
|
||||||
|
|||||||
Reference in New Issue
Block a user