Merge pull request #1975 from Bilb/allow-hiding-note-to-self

Allow hiding note to self
pull/1979/head
Audric Ackermann 4 years ago committed by GitHub
commit 9872a33f85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -77,7 +77,7 @@ const ConversationHeaderMenu = (props: PropsConversationHeaderMenu) => {
{getLeaveGroupMenuItem(isKickedFromGroup, left, isGroup, isPublic, conversationId)}
{/* TODO: add delete group */}
{getInviteContactMenuItem(isGroup, isPublic, conversationId)}
{getDeleteContactMenuItem(isMe, isGroup, isPublic, left, isKickedFromGroup, conversationId)}
{getDeleteContactMenuItem(isGroup, isPublic, left, isKickedFromGroup, conversationId)}
</Menu>
);
};

@ -69,7 +69,7 @@ const ConversationListItemContextMenu = (props: PropsContextConversationItem) =>
{getClearNicknameMenuItem(isMe, hasNickname, isGroup, conversationId)}
{getDeleteMessagesMenuItem(isPublic, conversationId)}
{getInviteContactMenuItem(isGroup, isPublic, conversationId)}
{getDeleteContactMenuItem(isMe, isGroup, isPublic, left, isKickedFromGroup, conversationId)}
{getDeleteContactMenuItem(isGroup, isPublic, left, isKickedFromGroup, conversationId)}
{getLeaveGroupMenuItem(isKickedFromGroup, left, isGroup, isPublic, conversationId)}
</Menu>
);

@ -75,14 +75,13 @@ function showCopyId(isPublic: boolean, isGroup: boolean): boolean {
}
function showDeleteContact(
isMe: boolean,
isGroup: boolean,
isPublic: boolean,
isGroupLeft: boolean,
isKickedFromGroup: boolean
): boolean {
// you need to have left a closed group first to be able to delete it completely.
return (!isMe && !isGroup) || (isGroup && (isGroupLeft || isKickedFromGroup || isPublic));
return !isGroup || (isGroup && (isGroupLeft || isKickedFromGroup || isPublic));
}
function showAddModerators(
@ -170,7 +169,6 @@ export const getPinConversationMenuItem = (conversationId: string): JSX.Element
};
export function getDeleteContactMenuItem(
isMe: boolean | undefined,
isGroup: boolean | undefined,
isPublic: boolean | undefined,
isLeft: boolean | undefined,
@ -181,7 +179,6 @@ export function getDeleteContactMenuItem(
if (
showDeleteContact(
Boolean(isMe),
Boolean(isGroup),
Boolean(isPublic),
Boolean(isLeft),

Loading…
Cancel
Save