mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-11 00:14:50 +03:00
Cleanup Quota handling
This commit is contained in:
parent
886e53bb8f
commit
9006c377fd
4 changed files with 7 additions and 18 deletions
|
|
@ -50,8 +50,8 @@ trait Quota
|
|||
if (!$this->hasCapability('QUOTA')) {
|
||||
return null;
|
||||
}
|
||||
$aReturn = array(0, 0, 0, 0);
|
||||
$oResponseCollection = $this->SendRequest(($root?'GETQUOTAROOT':'GETQUOTA') . " {$this->EscapeFolderName($sFolderName)}");
|
||||
$aReturn = array(0, 0);
|
||||
foreach ($this->yieldUntaggedResponses() as $oResponse) {
|
||||
if ('QUOTA' === $oResponse->StatusOrIndex
|
||||
&& isset($oResponse->ResponseList[3])
|
||||
|
|
|
|||
|
|
@ -86,14 +86,11 @@ trait Folders
|
|||
}
|
||||
|
||||
if ($oFolderCollection) {
|
||||
$aQuota = null;
|
||||
if ($this->GetCapa(Capa::QUOTA)) {
|
||||
try {
|
||||
// $aQuota = $this->ImapClient()->Quota();
|
||||
$aQuota = $this->ImapClient()->QuotaRoot();
|
||||
} catch (\Throwable $oException) {
|
||||
// ignore
|
||||
}
|
||||
try {
|
||||
// $aQuota = $this->ImapClient()->Quota();
|
||||
$aQuota = $this->ImapClient()->QuotaRoot();
|
||||
} catch (\Throwable $oException) {
|
||||
// ignore
|
||||
}
|
||||
|
||||
$aCapabilities = \array_values(\array_filter($this->ImapClient()->Capability() ?: [], function ($item) {
|
||||
|
|
|
|||
|
|
@ -225,21 +225,14 @@ trait User
|
|||
public function DoQuota() : array
|
||||
{
|
||||
$oAccount = $this->initMailClientConnection();
|
||||
|
||||
if (!$this->GetCapa(Capa::QUOTA)) {
|
||||
return $this->DefaultResponse(array(0, 0, 0, 0));
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$aQuota = $this->ImapClient()->QuotaRoot();
|
||||
return $this->DefaultResponse($this->ImapClient()->QuotaRoot() ?: [0, 0, 0, 0]);
|
||||
}
|
||||
catch (\Throwable $oException)
|
||||
{
|
||||
throw new ClientException(Notifications::MailServerError, $oException);
|
||||
}
|
||||
|
||||
return $this->DefaultResponse($aQuota);
|
||||
}
|
||||
|
||||
public function DoSuggestions() : array
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ abstract class Capa
|
|||
const ADDITIONAL_ACCOUNTS = 'AdditionalAccounts';
|
||||
const IDENTITIES = 'Identities';
|
||||
const CONTACTS = 'Contacts';
|
||||
const QUOTA = 'Quota';
|
||||
const ATTACHMENTS_ACTIONS = 'AttachmentsActions';
|
||||
const DANGEROUS_ACTIONS = 'DangerousActions';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue