|
|
|
@ -76,7 +76,7 @@
|
|
|
|
|
return {
|
|
|
|
|
unreadCount: 0,
|
|
|
|
|
verified: textsecure.storage.protocol.VerifiedStatus.DEFAULT,
|
|
|
|
|
keysPending: true
|
|
|
|
|
keyExchangeCompleted: false,
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
@ -398,29 +398,27 @@
|
|
|
|
|
return contact.isVerified();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
isKeysPending() {
|
|
|
|
|
if (this.isPrivate()) {
|
|
|
|
|
if (this.isMe()) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
const keysPending = this.get('keysPending');
|
|
|
|
|
if (keysPending === undefined) {
|
|
|
|
|
keysPending = true;
|
|
|
|
|
}
|
|
|
|
|
return keysPending;
|
|
|
|
|
isKeyExchangeCompleted() {
|
|
|
|
|
if (!this.isPrivate()) {
|
|
|
|
|
throw new Error(
|
|
|
|
|
'isKeyExchangeCompleted not implemented for groups'
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
throw new Error(
|
|
|
|
|
'isKeysPending not implemented for groups'
|
|
|
|
|
);
|
|
|
|
|
if (this.isMe()) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return this.get('keyExchangeCompleted') || false;
|
|
|
|
|
},
|
|
|
|
|
setKeysPending(keysPending) {
|
|
|
|
|
if (typeof keysPending !== 'boolean') {
|
|
|
|
|
setKeyExchangeCompleted(completed) {
|
|
|
|
|
if (typeof completed !== 'boolean') {
|
|
|
|
|
throw new Error(
|
|
|
|
|
'setKeysPending expects a boolean'
|
|
|
|
|
'setKeyExchangeCompleted expects a bool'
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
this.set({ keysPending });
|
|
|
|
|
|
|
|
|
|
this.set({ keyExchangeCompleted: completed });
|
|
|
|
|
},
|
|
|
|
|
isUnverified() {
|
|
|
|
|
if (this.isPrivate()) {
|
|
|
|
|