mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-02 14:07:04 +03:00
Split RainLoop/Actions.php and use JsonSerializable
This commit is contained in:
parent
8cd2bd46d8
commit
9844c1882c
24 changed files with 3205 additions and 3066 deletions
|
|
@ -2,7 +2,6 @@ import ko from 'ko';
|
|||
|
||||
import { ContactPropertyType } from 'Common/Enums';
|
||||
import { pInt, pString } from 'Common/Utils';
|
||||
import { emptyContactPic } from 'Common/Links';
|
||||
|
||||
import { AbstractModel } from 'Knoin/AbstractModel';
|
||||
|
||||
|
|
@ -10,7 +9,7 @@ class ContactModel extends AbstractModel {
|
|||
constructor() {
|
||||
super();
|
||||
|
||||
this.idContact = 0;
|
||||
this.id = 0;
|
||||
this.display = '';
|
||||
this.properties = [];
|
||||
this.readOnly = false;
|
||||
|
|
@ -53,11 +52,11 @@ class ContactModel extends AbstractModel {
|
|||
static reviveFromJson(json) {
|
||||
const contact = super.reviveFromJson(json);
|
||||
if (contact) {
|
||||
contact.idContact = pInt(json.IdContact);
|
||||
contact.display = pString(json.Display);
|
||||
contact.readOnly = !!json.ReadOnly;
|
||||
contact.id = pInt(json.id);
|
||||
contact.display = pString(json.display);
|
||||
contact.readOnly = !!json.readOnly;
|
||||
|
||||
if (Array.isNotEmpty(json.Properties)) {
|
||||
if (Array.isNotEmpty(json.properties)) {
|
||||
json.Properties.forEach(property => {
|
||||
if (property && property.Type && null != property.Value && null != property.TypeStr) {
|
||||
contact.properties.push([pInt(property.Type), pString(property.Value), pString(property.TypeStr)]);
|
||||
|
|
@ -68,18 +67,11 @@ class ContactModel extends AbstractModel {
|
|||
return contact;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string}
|
||||
*/
|
||||
srcAttr() {
|
||||
return emptyContactPic();
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string}
|
||||
*/
|
||||
generateUid() {
|
||||
return pString(this.idContact);
|
||||
return pString(this.id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue