|
@@ -16,17 +16,25 @@ export class ContactItem {
|
|
|
this.groups = props.groups || [];
|
|
this.groups = props.groups || [];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public matchesAddressOrName(search: string) {
|
|
|
|
|
|
|
+ public matchesAddressOrName(search: string): boolean {
|
|
|
if (this.addrs.filter(x => x.indexOf(search.trim()) >= 0)[0].length > 0) {
|
|
if (this.addrs.filter(x => x.indexOf(search.trim()) >= 0)[0].length > 0) {
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public matchesGroup(group: string) {
|
|
|
|
|
|
|
+ public matchesGroup(group: string): boolean {
|
|
|
if (this.groups.filter(x => x === group.trim())[0].length > 0) {
|
|
if (this.groups.filter(x => x === group.trim())[0].length > 0) {
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ public getFirstEmail(): string | undefined {
|
|
|
|
|
+ const prefixed = this.addrs.filter(x => x.startsWith('email:'))[0];
|
|
|
|
|
+ if (prefixed == null) {
|
|
|
|
|
+ return undefined;
|
|
|
|
|
+ }
|
|
|
|
|
+ return prefixed.substring(6);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|