Changed Quota() to QuotaRoot(string $sFolderName = 'INBOX')

After reading RainLoop#2086 and looking in the source i noticed the incorrect naming
This commit is contained in:
djmaze 2021-08-19 17:00:31 +02:00
parent 5f73b721e6
commit ee7d06fbfd
4 changed files with 40 additions and 6 deletions

View file

@ -594,14 +594,33 @@ class ImapClient extends \MailSo\Net\NetClient
}
/**
* https://datatracker.ietf.org/doc/html/rfc2087#section-4.2
*
* @throws \MailSo\Net\Exceptions\Exception
* @throws \MailSo\Imap\Exceptions\Exception
*/
public function Quota() : ?array
* /
public function Quota(string $sRootName = '') : ?array
{
if ($this->IsSupported('QUOTA'))
{
return $this->SendRequestGetResponse('GETQUOTAROOT "INBOX"')->getQuotaResult();
return $this->SendRequestGetResponse("GETQUOTA {$this->EscapeString($sRootName)}")->getQuotaResult();
}
return null;
}
*/
/**
* https://datatracker.ietf.org/doc/html/rfc2087#section-4.3
*
* @throws \MailSo\Net\Exceptions\Exception
* @throws \MailSo\Imap\Exceptions\Exception
*/
public function QuotaRoot(string $sFolderName = 'INBOX') : ?array
{
if ($this->IsSupported('QUOTA'))
{
return $this->SendRequestGetResponse("GETQUOTAROOT {$this->EscapeString($sFolderName)}")->getQuotaResult();
}
return null;

View file

@ -1808,9 +1808,9 @@ class MailClient
return $oMessageCollection;
}
public function Quota() : ?array
public function QuotaRoot(string $sFolderName = 'INBOX') : ?array
{
return $this->oImapClient->Quota();
return $this->oImapClient->QuotaRoot($sFolderName);
}
public function FindMessageUidByMessageId(string $sFolderName, string $sMessageId) : ?int

View file

@ -372,7 +372,7 @@ trait User
try
{
$aQuota = $this->MailClient()->Quota();
$aQuota = $this->MailClient()->QuotaRoot();
}
catch (\Throwable $oException)
{

View file

@ -22,6 +22,13 @@ abstract class L10n
$aList[] = \basename($dir);
}
}
/*
foreach (\glob(APP_PLUGINS_PATH . 'language-*', GLOB_ONLYDIR) as $dir) {
if (\is_file($dir . ($bAdmin ? '/admin' : '/user') . '.json')) {
$aList[] = \substr(\basename($dir), 9);
}
}
*/
\sort($aList);
$aCache[$bAdmin] = $aList;
return $aCache[$bAdmin];
@ -29,6 +36,7 @@ abstract class L10n
/**
* When $sLanguage is like 'sv-SE', it tries to load and merge (in order): en, sv and sv-SE
* $sFile is either 'admin', 'static' or 'user'
*/
public static function load(string $sLanguage, string $sFile) : array
{
@ -40,6 +48,13 @@ abstract class L10n
if (\is_file($file)) {
$aLang = \array_replace_recursive($aLang, \json_decode(\file_get_contents($file), true));
}
/* else {
$file = APP_PLUGINS_PATH."language-{$sLanguage}/{$sFile}.json";
if (\is_file($file)) {
$aLang = \array_replace_recursive($aLang, \json_decode(\file_get_contents($file), true));
}
}
*/
}
return $aLang;
}