store key bundle status in conversation model

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

@ -76,6 +76,7 @@
return { return {
unreadCount: 0, unreadCount: 0,
verified: textsecure.storage.protocol.VerifiedStatus.DEFAULT, verified: textsecure.storage.protocol.VerifiedStatus.DEFAULT,
keysPending: true
}; };
}, },
@ -397,6 +398,18 @@
return contact.isVerified(); 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() { isUnverified() {
if (this.isPrivate()) { if (this.isPrivate()) {
const verified = this.get('verified'); const verified = this.get('verified');

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

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

Loading…
Cancel
Save