mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-05 07:27:04 +03:00
Identities redesign
This commit is contained in:
parent
df1c369a9d
commit
44241b859c
22 changed files with 267 additions and 183 deletions
|
|
@ -1330,7 +1330,8 @@ class Actions
|
|||
{
|
||||
foreach ($aSubIdentities as $aItem)
|
||||
{
|
||||
if (isset($aItem['Id'], $aItem['Email'], $aItem['Name'], $aItem['ReplyTo'], $aItem['Bcc']))
|
||||
if (isset($aItem['Id'], $aItem['Email'], $aItem['Name'], $aItem['ReplyTo'], $aItem['Bcc']) &&
|
||||
$aItem['Id'] !== $oAccount->Email())
|
||||
{
|
||||
$oItem = \RainLoop\Identity::NewInstance($aItem['Id'], $aItem['Email'],
|
||||
$aItem['Name'], $aItem['ReplyTo'], $aItem['Bcc']);
|
||||
|
|
@ -1339,14 +1340,6 @@ class Actions
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (0 === \count($aIdentities))
|
||||
{
|
||||
$aIdentities[] = \RainLoop\Identity::NewInstance($oAccount->Email(), $oAccount->Email(),
|
||||
$oSettings->GetConf('DisplayName', ''),
|
||||
$oSettings->GetConf('ReplyTo', '')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return $aIdentities;
|
||||
|
|
@ -1514,20 +1507,6 @@ class Actions
|
|||
$sReplyTo = \trim($this->GetActionParam('ReplyTo', ''));
|
||||
$sBcc = \trim($this->GetActionParam('Bcc', ''));
|
||||
|
||||
if ($sId === $oAccount->Email())
|
||||
{
|
||||
$sEmail = $oAccount->Email();
|
||||
|
||||
$oSettings = $this->SettingsProvider()->Load($oAccount);
|
||||
if ($oSettings)
|
||||
{
|
||||
$oSettings->SetConf('DisplayName', $sName);
|
||||
$oSettings->SetConf('ReplyTo', $sReplyTo);
|
||||
|
||||
$this->SettingsProvider()->Save($oAccount, $oSettings);
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($sEmail))
|
||||
{
|
||||
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::UnknownError);
|
||||
|
|
@ -1583,7 +1562,7 @@ class Actions
|
|||
$oAccount = $this->getAccountFromToken();
|
||||
|
||||
$sId = \trim($this->GetActionParam('IdToDelete', ''));
|
||||
if (empty($sId) || $sId === $oAccount->Email())
|
||||
if (empty($sId))
|
||||
{
|
||||
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::UnknownError);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue