Merge pull request #11 from sachaaaaa/key_exchange_status

Change keysPending flag to keyExchangeCompleted in conversation model
pull/14/head
sachaaaaa 7 years ago committed by GitHub
commit b432700fe8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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()) {

@ -160,7 +160,7 @@
color: this.model.getColor(),
avatarPath,
isVerified: this.model.isVerified(),
isKeysPending: this.model.isKeysPending(),
isKeysPending: this.model.isKeyExchangeCompleted() == false,
isMe: this.model.isMe(),
isGroup: !this.model.isPrivate(),
expirationSettingName,

Loading…
Cancel
Save