|
|
@ -198,15 +198,20 @@
|
|
|
|
isOnline() {
|
|
|
|
isOnline() {
|
|
|
|
return this.isMe() || this.get('isOnline');
|
|
|
|
return this.isMe() || this.get('isOnline');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
isMe() {
|
|
|
|
isMe() {
|
|
|
|
|
|
|
|
return this.isOurLocalDevice() || this.isOurPrimaryDevice();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
isOurPrimaryDevice() {
|
|
|
|
return this.id === window.storage.get('primaryDevicePubKey');
|
|
|
|
return this.id === window.storage.get('primaryDevicePubKey');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
async isOurDevice() {
|
|
|
|
async isOurDevice() {
|
|
|
|
const ourDevices = await window.libloki.storage.getPairedDevicesFor(
|
|
|
|
const ourDevices = await window.libloki.storage.getPairedDevicesFor(
|
|
|
|
this.ourNumber
|
|
|
|
this.ourNumber
|
|
|
|
);
|
|
|
|
);
|
|
|
|
return this.id === this.ourNumber || ourDevices.includes(this.id);
|
|
|
|
return this.isOurLocalDevice() || ourDevices.includes(this.id);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
isOurLocalDevice() {
|
|
|
|
|
|
|
|
return this.id === this.ourNumber;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
isPublic() {
|
|
|
|
isPublic() {
|
|
|
|
return !!(this.id && this.id.match(/^publicChat:/));
|
|
|
|
return !!(this.id && this.id.match(/^publicChat:/));
|
|
|
@ -892,9 +897,6 @@
|
|
|
|
throw new Error('Invalid friend request state');
|
|
|
|
throw new Error('Invalid friend request state');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
isOurConversation() {
|
|
|
|
|
|
|
|
return this.id === this.ourNumber;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
isSecondaryDevice() {
|
|
|
|
isSecondaryDevice() {
|
|
|
|
return !!this.get('secondaryStatus');
|
|
|
|
return !!this.get('secondaryStatus');
|
|
|
|
},
|
|
|
|
},
|
|
|
|