show Delete conversation menu when we got removed from the group too

pull/1467/head
Audric Ackermann 4 years ago
parent f179694439
commit 446a1ecefb
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -1360,7 +1360,11 @@
let title = i18n('delete'); let title = i18n('delete');
let message = i18n('deleteContactConfirmation'); let message = i18n('deleteContactConfirmation');
if (this.isGroup()) { if (
this.isGroup() &&
!this.get('left') &&
!this.get('isKickedFromGroup')
) {
title = i18n('leaveGroup'); title = i18n('leaveGroup');
message = i18n('leaveGroupConfirmation'); message = i18n('leaveGroupConfirmation');
} }

@ -126,6 +126,7 @@ export const ConversationHeaderMenu = (props: PropsConversationHeaderMenu) => {
isGroup, isGroup,
isPublic, isPublic,
left, left,
isKickedFromGroup,
onDeleteContact, onDeleteContact,
window.i18n window.i18n
)} )}

@ -93,6 +93,7 @@ export const ConversationListItemContextMenu = (
type === 'group', type === 'group',
isPublic, isPublic,
left, left,
isKickedFromGroup,
onDeleteContact, onDeleteContact,
window.i18n window.i18n
)} )}

@ -40,10 +40,11 @@ function showDeleteContact(
isMe: boolean, isMe: boolean,
isGroup: boolean, isGroup: boolean,
isPublic: boolean, isPublic: boolean,
isGroupLeft: boolean isGroupLeft: boolean,
isKickedFromGroup: boolean
): boolean { ): boolean {
// you need to have left a closed group first to be able to delete it completely. // you need to have left a closed group first to be able to delete it completely.
return (!isMe && !isGroup) || (isGroup && isGroupLeft); return (!isMe && !isGroup) || (isGroup && (isGroupLeft || isKickedFromGroup));
} }
function showAddModerators( function showAddModerators(
@ -100,6 +101,7 @@ export function getDeleteContactMenuItem(
isGroup: boolean | undefined, isGroup: boolean | undefined,
isPublic: boolean | undefined, isPublic: boolean | undefined,
isLeft: boolean | undefined, isLeft: boolean | undefined,
isKickedFromGroup: boolean | undefined,
action: any, action: any,
i18n: LocalizerType i18n: LocalizerType
): JSX.Element | null { ): JSX.Element | null {
@ -108,7 +110,8 @@ export function getDeleteContactMenuItem(
Boolean(isMe), Boolean(isMe),
Boolean(isGroup), Boolean(isGroup),
Boolean(isPublic), Boolean(isPublic),
Boolean(isLeft) Boolean(isLeft),
Boolean(isKickedFromGroup)
) )
) { ) {
if (isPublic) { if (isPublic) {

Loading…
Cancel
Save