mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Bugfix: when allowMultipleIdentities is false always return primaryIdentity
This commit is contained in:
parent
6ae38bfe1b
commit
dff89ea4e0
2 changed files with 6 additions and 4 deletions
|
|
@ -43,8 +43,8 @@ class Identity implements \JsonSerializable
|
||||||
|
|
||||||
function __construct(string $sId = '', string $sEmail = '')
|
function __construct(string $sId = '', string $sEmail = '')
|
||||||
{
|
{
|
||||||
$this->sId = empty($sId) ? '' : $sId;
|
$this->sId = $sId;
|
||||||
$this->sEmail = empty($sEmail) ? '' : $sEmail;
|
$this->sEmail = $sEmail;
|
||||||
$this->sName = '';
|
$this->sName = '';
|
||||||
$this->sReplyTo = '';
|
$this->sReplyTo = '';
|
||||||
$this->sBcc = '';
|
$this->sBcc = '';
|
||||||
|
|
|
||||||
|
|
@ -43,8 +43,10 @@ class Identities extends AbstractProvider
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// If no primary identity is found, generate default one from account info
|
// If no primary identity is found, generate default one from account info
|
||||||
if ($primaryIdentity === null || $primaryIdentity === false)
|
if ($primaryIdentity === null || $primaryIdentity === false) {
|
||||||
$identities[] = $primaryIdentity = new Identity('', $account->Email());
|
$primaryIdentity = $primaryIdentity = new Identity('', $account->Email());
|
||||||
|
$identities[] = $primaryIdentity;
|
||||||
|
}
|
||||||
|
|
||||||
// Return only primary identity or all identities
|
// Return only primary identity or all identities
|
||||||
return $allowMultipleIdentities ? $identities : [$primaryIdentity];
|
return $allowMultipleIdentities ? $identities : [$primaryIdentity];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue