mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-02-24 14:57:26 +08:00
Add more logging for #907
This commit is contained in:
parent
f2ca5f6a30
commit
636ffe5fbb
1 changed files with 7 additions and 4 deletions
|
@ -36,7 +36,7 @@ class MailboxDetectPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
$oActions = \RainLoop\Api::Actions();
|
||||
$oAccount = $oActions->getAccountFromToken();
|
||||
if (!$oAccount) {
|
||||
\error_log('No Account');
|
||||
$this->Logger()->Write('No Account');
|
||||
return;
|
||||
}
|
||||
$oSettingsLocal = $oActions->SettingsProvider(true)->Load($oAccount);
|
||||
|
@ -114,8 +114,9 @@ class MailboxDetectPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
foreach ($found as $role => $folders) {
|
||||
if (isset($folders[0])) {
|
||||
// Set the first as default
|
||||
// \error_log("Set role {$role}");
|
||||
$aResponse['Result']['@Collection'][$folders[0]]['role'] = $role;
|
||||
$aFolder = &$aResponse['Result']['@Collection'][$folders[0]];
|
||||
$this->Logger()->Write("Set {$role} mailbox to {$aFolder['fullName']}");
|
||||
$aFolder['role'] = $role;
|
||||
} else if ($this->Config()->Get('plugin', 'autocreate_system_folders', false)) {
|
||||
try
|
||||
{
|
||||
|
@ -136,7 +137,7 @@ class MailboxDetectPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
}
|
||||
}
|
||||
*/
|
||||
// \error_log("Create mailbox {$sFolderNameToCreate}");
|
||||
$this->Logger()->Write("Create {$role} mailbox {$sFolderNameToCreate}");
|
||||
$aFolder = $oActions->MailClient()->FolderCreate(
|
||||
$sFolderNameToCreate,
|
||||
$sParent,
|
||||
|
@ -150,6 +151,8 @@ class MailboxDetectPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
{
|
||||
$this->Logger()->WriteException($oException);
|
||||
}
|
||||
} else {
|
||||
$this->Logger()->Write("Mailbox for {$role} not created");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue