Remove ability to delete some rss conversations

pull/429/head
Beaudan Brown 6 years ago
parent 3f4b94ba74
commit 662c64f347

@ -196,6 +196,9 @@
isPublic() {
return this.id.match(/^publicChat:/);
},
isClosable() {
return !this.isRss() || this.get('closable');
},
isRss() {
return this.id && this.id.match(/^rss:/);
},
@ -441,6 +444,7 @@
color,
type: this.isPrivate() ? 'direct' : 'group',
isMe: this.isMe(),
isClosable: this.isClosable(),
isTyping: typingKeys.length > 0,
lastUpdated: this.get('timestamp'),
name: this.getName(),

@ -201,6 +201,7 @@
isVerified: this.model.isVerified(),
isKeysPending: !this.model.isFriend(),
isMe: this.model.isMe(),
isClosable: this.model.isClosable(),
isBlocked: this.model.isBlocked(),
isGroup: !this.model.isPrivate(),
isOnline: this.model.isOnline(),

@ -21,6 +21,7 @@ export type PropsData = {
type: 'group' | 'direct';
avatarPath?: string;
isMe: boolean;
isClosable?: boolean;
lastUpdated: number;
unreadCount: number;
@ -163,6 +164,7 @@ export class ConversationListItem extends React.PureComponent<Props> {
i18n,
isBlocked,
isMe,
isClosable,
hasNickname,
onDeleteContact,
onDeleteMessages,
@ -191,7 +193,7 @@ export class ConversationListItem extends React.PureComponent<Props> {
) : null}
<MenuItem onClick={onCopyPublicKey}>{i18n('copyPublicKey')}</MenuItem>
<MenuItem onClick={onDeleteMessages}>{i18n('deleteMessages')}</MenuItem>
{!isMe ? (
{!isMe && isClosable ? (
<MenuItem onClick={onDeleteContact}>{i18n('deleteContact')}</MenuItem>
) : null}
</ContextMenu>

@ -26,6 +26,7 @@ interface Props {
isVerified: boolean;
isMe: boolean;
isClosable?: boolean;
isGroup: boolean;
isArchived: boolean;
@ -201,6 +202,7 @@ export class ConversationHeader extends React.Component<Props> {
i18n,
isBlocked,
isMe,
isClosable,
isGroup,
isArchived,
onDeleteMessages,
@ -275,7 +277,7 @@ export class ConversationHeader extends React.Component<Props> {
<MenuItem onClick={onArchive}>{i18n('archiveConversation')}</MenuItem>
)}
<MenuItem onClick={onDeleteMessages}>{i18n('deleteMessages')}</MenuItem>
{!isMe ? (
{!isMe && isClosable ? (
<MenuItem onClick={onDeleteContact}>{i18n('deleteContact')}</MenuItem>
) : null}
</ContextMenu>

@ -45,6 +45,7 @@ export type ConversationType = {
phoneNumber: string;
type: 'direct' | 'group';
isMe: boolean;
isClosable?: boolean;
lastUpdated: number;
unreadCount: number;
isSelected: boolean;

Loading…
Cancel
Save