mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-10 15:08:28 +03:00
Small refactoring: Identity
This commit is contained in:
parent
e3b62d24d8
commit
2ab17f8eff
3 changed files with 6 additions and 6 deletions
|
|
@ -19,7 +19,7 @@
|
|||
{
|
||||
AbstractModel.call(this, 'IdentityModel');
|
||||
|
||||
this.id = ko.observable(sId);
|
||||
this.id = ko.observable(sId || '');
|
||||
this.email = ko.observable(sEmail);
|
||||
this.name = ko.observable('');
|
||||
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@
|
|||
{
|
||||
this.edit(true);
|
||||
|
||||
this.id = oIdentity.id();
|
||||
this.id = oIdentity.id() || '';
|
||||
this.name(oIdentity.name());
|
||||
this.email(oIdentity.email());
|
||||
this.replyTo(oIdentity.replyTo());
|
||||
|
|
|
|||
|
|
@ -47,8 +47,8 @@ class Identity
|
|||
*/
|
||||
protected function __construct($sId = '', $sEmail = '')
|
||||
{
|
||||
$this->sId = $sId;
|
||||
$this->sEmail = $sEmail;
|
||||
$this->sId = empty($sId) ? '' : $sId;
|
||||
$this->sEmail = empty($sEmail) ? '' : $sEmail;
|
||||
$this->sName = '';
|
||||
$this->sReplyTo = '';
|
||||
$this->sBcc = '';
|
||||
|
|
@ -152,9 +152,9 @@ class Identity
|
|||
*/
|
||||
public function FromJSON($aData, $bAjax = false)
|
||||
{
|
||||
if (isset($aData['Id'], $aData['Email']) && !empty($aData['Email']))
|
||||
if (!empty($aData['Email']))
|
||||
{
|
||||
$this->sId = $aData['Id'];
|
||||
$this->sId = !empty($aData['Id']) ? $aData['Id'] : '';
|
||||
$this->sEmail = $bAjax ? \MailSo\Base\Utils::IdnToAscii($aData['Email'], true) : $aData['Email'];
|
||||
$this->sName = isset($aData['Name']) ? $aData['Name'] : '';
|
||||
$this->sReplyTo = !empty($aData['ReplyTo']) ? $aData['ReplyTo'] : '';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue