blob: b21ddcddd71d1261f4d1e1489a22426944b78d8f [file] [log] [blame]
Adrien BĂ©raud0cb76c92021-04-07 19:59:08 -04001class Contact {
2 constructor(uri) {
3 this.uri = uri
4 this.displayName = undefined
5 this.registeredName = undefined
6 }
7
8 static from(object) {
9 return new Contact(object.uri)
10 }
11
12 getUri() { return this.uri }
13
14 getRegisteredName() { this.registeredName }
15
16 getDisplayName() {
17 return this.displayName || this.getRegisteredName() || this.getUri()
18 }
19
20 getObject() {
21 return {
22 uri: this.uri
23 }
24 }
25}
26
27module.exports = Contact;