mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-23 00:13:35 +01:00
report and log enabling push (and other IMAP errors)
don't switch regular reload handling off in that case
This commit is contained in:
parent
2dc83c410c
commit
547f28fe3d
@ -1518,7 +1518,17 @@ class Imap extends Horde_Imap_Client_Socket implements Imap\PushIface
|
|||||||
self::METADATA_NAME => self::METADATA_PREFIX.implode(self::METADATA_SEPARATOR, $metadata),
|
self::METADATA_NAME => self::METADATA_PREFIX.implode(self::METADATA_SEPARATOR, $metadata),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
catch (Horde_Imap_Client_Exception $e) {
|
catch (\Horde_Imap_Client_Exception $e) {
|
||||||
|
if (Api\Json\Response::isJSONResponse())
|
||||||
|
{
|
||||||
|
// report error to user once per session
|
||||||
|
Api\Cache::getSession(__CLASS__, __FUNCTION__, static function() use ($e)
|
||||||
|
{
|
||||||
|
Api\Json\Response::get()->message(lang("Error enabling push")."\n".
|
||||||
|
$e->getMessage().(!empty($e->details) ? "\n".$e->details : ''), 'error');
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
_egw_log_exception($e);
|
_egw_log_exception($e);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,8 @@ function _egw_log_exception($e,&$headline=null)
|
|||||||
// which outputs the error_log to stderr and therefore output it twice to the user
|
// which outputs the error_log to stderr and therefore output it twice to the user
|
||||||
if(isset($_SERVER['HTTP_HOST']) || $GLOBALS['egw_info']['flags']['no_exception_handler'] !== 'cli')
|
if(isset($_SERVER['HTTP_HOST']) || $GLOBALS['egw_info']['flags']['no_exception_handler'] !== 'cli')
|
||||||
{
|
{
|
||||||
error_log($headline.($e instanceof egw_exception_warning ? ': ' : ' ('.get_class($e).'): ').$e->getMessage());
|
error_log($headline.($e instanceof egw_exception_warning ? ': ' : ' ('.get_class($e).'): ').
|
||||||
|
$e->getMessage().(!empty($e->details) ? ': '.$e->details : ''));
|
||||||
foreach($trace as $line)
|
foreach($trace as $line)
|
||||||
{
|
{
|
||||||
error_log($line);
|
error_log($line);
|
||||||
|
@ -1558,12 +1558,12 @@ class mail_ui
|
|||||||
}
|
}
|
||||||
if (empty($query['selectedFolder'])) $query['selectedFolder'] = $mail_ui->mail_bo->profileID.self::$delimiter.'INBOX';
|
if (empty($query['selectedFolder'])) $query['selectedFolder'] = $mail_ui->mail_bo->profileID.self::$delimiter.'INBOX';
|
||||||
}
|
}
|
||||||
// enable push notifications, if supported (and konfigured) by the server
|
// enable push notifications, if supported (and configured) by the server
|
||||||
if ($mail_ui->mail_bo->icServer instanceof Api\Mail\Imap\PushIface &&
|
if ($mail_ui->mail_bo->icServer instanceof Api\Mail\Imap\PushIface &&
|
||||||
$mail_ui->mail_bo->icServer->pushAvailable())
|
$mail_ui->mail_bo->icServer->pushAvailable())
|
||||||
{
|
{
|
||||||
$mail_ui->mail_bo->icServer->enablePush();
|
Api\Json\Response::get()->call('app.mail.disable_autorefresh',
|
||||||
Api\Json\Response::get()->call('app.mail.disable_autorefresh', true);
|
$mail_ui->mail_bo->icServer->enablePush());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user