* Notifications/Async service: fix caching in mail account always used sender from first notification

This commit is contained in:
ralf 2024-02-21 09:04:23 +02:00
parent e7d66f22e6
commit 1c608ac6a5
2 changed files with 2 additions and 2 deletions

View File

@ -1073,7 +1073,7 @@ class Account implements \ArrayAccess
{
//error_log(__METHOD__."($acc_id, ".array2string($called_for).")");
// some caching, but only for regular usage/users
if (!isset($called_for))
if (!isset($called_for) && (!isset(self::$instances[$acc_id]) || self::$instances[$acc_id]->user == $GLOBALS['egw_info']['user']['account_id']))
{
// act as singleton: if we already have an instance, return it
if (isset(self::$instances[$acc_id]))

View File

@ -81,7 +81,7 @@ class notifications_email implements notifications_iface {
$ident = null;
if($this->config->async_identity)
{
$ident = Api\Mail\Account::read($this->config->async_identity);
$ident = Api\Mail\Account::read($this->config->async_identity, $_sender->account_id ?? null);
}
$this->mail = new Api\Mailer($ident);
}