store key bundle status in conversation model

pull/6/head
sachaaaaa 7 years ago
parent 33ad509fbf
commit 22a86b5351

@ -76,6 +76,7 @@
return {
unreadCount: 0,
verified: textsecure.storage.protocol.VerifiedStatus.DEFAULT,
keysPending: true
};
},
@ -397,6 +398,18 @@
return contact.isVerified();
});
},
isKeysPending() {
if (this.isPrivate()) {
if (this.isMe()) {
return false;
}
return this.get('keysPending') || true;
}
throw new Error(
'isKeysPending not implemented for groups'
);
},
isUnverified() {
if (this.isPrivate()) {
const verified = this.get('verified');

@ -126,7 +126,7 @@
this.lazyUpdateVerified = _.debounce(
this.model.updateVerified.bind(this.model),
1000 // one second
);
);
this.throttledGetProfiles = _.throttle(
this.model.getProfiles.bind(this.model),
1000 * 60 * 5 // five minutes
@ -160,6 +160,7 @@
color: this.model.getColor(),
avatarPath,
isVerified: this.model.isVerified(),
isKeysPending: this.model.isKeysPending(),
isMe: this.model.isMe(),
isGroup: !this.model.isPrivate(),
expirationSettingName,

@ -22,6 +22,7 @@ interface Trigger {
interface Props {
i18n: Localizer;
isVerified: boolean;
isKeysPending: boolean;
name?: string;
id: string;
phoneNumber: string;
@ -88,7 +89,7 @@ export class ConversationHeader extends React.Component<Props> {
}
public renderTitle() {
const { name, phoneNumber, i18n, profileName, isVerified } = this.props;
const { name, phoneNumber, i18n, profileName, isVerified, isKeysPending } = this.props;
return (
<div className="module-conversation-header__title">
@ -107,6 +108,7 @@ export class ConversationHeader extends React.Component<Props> {
{i18n('verified')}
</span>
) : null}
{isKeysPending ? '(pending)' : null}
</div>
);
}

Loading…
Cancel
Save