|
|
@@ -5,8 +5,9 @@ export class ContactItem {
|
|
|
public readonly data: ContactParams;
|
|
|
public readonly id: string;
|
|
|
public readonly hash: string;
|
|
|
- public readonly addrs: string[];
|
|
|
- public readonly groups: string[];
|
|
|
+ public addrs: string[];
|
|
|
+ public groups: string[];
|
|
|
+ public notes: string;
|
|
|
|
|
|
constructor(props: ContactParams) {
|
|
|
this.data = props;
|
|
|
@@ -14,6 +15,7 @@ export class ContactItem {
|
|
|
this.id = props.id;
|
|
|
this.addrs = props.addrs || [];
|
|
|
this.groups = props.groups || [];
|
|
|
+ this.notes = props.notes || '';
|
|
|
}
|
|
|
|
|
|
public matchesAddressOrName(search: string): boolean {
|
|
|
@@ -40,5 +42,15 @@ export class ContactItem {
|
|
|
|
|
|
public getMatchingAddresses(search: string): string[] {
|
|
|
return this.addrs.filter(x => x.indexOf(search) >= 0);
|
|
|
- }
|
|
|
+ }
|
|
|
+
|
|
|
+ public getData(): ContactParams {
|
|
|
+ return {
|
|
|
+ addrs: this.addrs,
|
|
|
+ groups: this.groups,
|
|
|
+ hash: this.hash,
|
|
|
+ id: this.id,
|
|
|
+ notes: this.notes
|
|
|
+ };
|
|
|
+ }
|
|
|
}
|