Skip to content

Commit

Permalink
feat: Remove a group from my conversation list after leaving it (#18516)
Browse files Browse the repository at this point in the history
  • Loading branch information
przemvs authored Dec 17, 2024
1 parent 44a4ebc commit 9b25578
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/i18n/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@
"conversationDetailsActionGuestOptions": "Guests",
"conversationDetailsActionLeave": "Leave group",
"conversationDetailsActionNotifications": "Notifications",
"conversationDetailsActionRemove": "Remove group",
"conversationDetailsActionDeleteForMe": "Delete for Me",
"conversationDetailsActionServicesOptions": "Services",
"conversationDetailsActionTimedMessages": "Self-deleting messages",
"conversationDetailsActionUnblock": "Unblock",
Expand Down Expand Up @@ -597,6 +597,7 @@
"conversationsPopoverBlock": "Block",
"conversationsPopoverCancel": "Cancel request",
"conversationsPopoverClear": "Clear content",
"conversationsPopoverDeleteForMe": "Delete for Me",
"conversationsPopoverLeave": "Leave group",
"conversationsPopoverMoveTo": "Move to",
"conversationsPopoverNewFolder": "Create new folder",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ const getConversationActions = ({
click: () => actionsViewModel.removeConversation(conversationEntity),
Icon: Icon.CloseIcon,
identifier: 'do-remove',
label: t('conversationDetailsActionRemove'),
label: t('conversationDetailsActionDeleteForMe'),
},
},
];
Expand Down
12 changes: 12 additions & 0 deletions src/script/view_model/ListViewModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import {ContentViewModel} from './ContentViewModel';
import type {MainViewModel, ViewModelRepositories} from './MainViewModel';

import type {CallingRepository} from '../calling/CallingRepository';
import {Config} from '../Config';
import type {ConversationRepository} from '../conversation/ConversationRepository';
import {ConversationState} from '../conversation/ConversationState';
import type {Conversation} from '../entity/Conversation';
Expand Down Expand Up @@ -446,6 +447,17 @@ export class ListViewModel {
});
}

if (
Config.getConfig().FEATURE.ENABLE_REMOVE_GROUP_CONVERSATION &&
conversationEntity.isGroup() &&
conversationEntity.isSelfUserRemoved()
) {
entries.push({
click: () => this.actionsViewModel.removeConversation(conversationEntity),
label: t('conversationsPopoverDeleteForMe'),
});
}

showContextMenu({event, entries, identifier: 'conversation-list-options-menu'});
};

Expand Down
13 changes: 7 additions & 6 deletions src/types/i18n.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ declare module 'I18n/en-US.json' {
'conversationDetailsActionGuestOptions': `Guests`;
'conversationDetailsActionLeave': `Leave group`;
'conversationDetailsActionNotifications': `Notifications`;
'conversationDetailsActionRemove': `Remove group`;
'conversationDetailsActionDeleteForMe': `Delete for Me`;
'conversationDetailsActionServicesOptions': `Services`;
'conversationDetailsActionTimedMessages': `Self-deleting messages`;
'conversationDetailsActionUnblock': `Unblock`;
Expand Down Expand Up @@ -601,6 +601,7 @@ declare module 'I18n/en-US.json' {
'conversationsPopoverBlock': `Block`;
'conversationsPopoverCancel': `Cancel request`;
'conversationsPopoverClear': `Clear content`;
'conversationsPopoverDeleteForMe': `Delete for Me`;
'conversationsPopoverLeave': `Leave group`;
'conversationsPopoverMoveTo': `Move to`;
'conversationsPopoverNewFolder': `Create new folder`;
Expand Down Expand Up @@ -1380,13 +1381,13 @@ declare module 'I18n/en-US.json' {
'replyQuoteShowMore': `Show more`;
'replyQuoteTimeStampDate': `Original message from {date}`;
'replyQuoteTimeStampTime': `Original message from {time}`;
'richTextHeading': `Heading`;
'richTextBold': `Bold`;
'richTextCode': `Code`;
'richTextHeading': `Heading`;
'richTextItalic': `Italic`;
'richTextOrderedList': `Ordered list`;
'richTextStrikethrough': `Strikethrough`;
'richTextUnorderedList': `Unordered list`;
'richTextOrderedList': `Ordered list`;
'richTextCode': `Code`;
'roleAdmin': `Admin`;
'roleOwner': `Owner`;
'rolePartner': `External`;
Expand Down Expand Up @@ -1625,12 +1626,12 @@ declare module 'I18n/en-US.json' {
'videoCallOverlayViewModeLabel': `View mode`;
'videoCallOverlayViewModeSpeakers': `Show active speakers only`;
'videoCallParticipantConnecting': `Connecting...`;
'videoCallParticipantLowerYourHand': `Lower your hand`;
'videoCallParticipantRaiseYourHand': `Raise your hand`;
'videoCallParticipantRaisedHandRaiseDuration': `Hand raised for {duration}`;
'videoCallParticipantRaisedSelfHandUp': `You have raised your hand up`;
'videoCallParticipantRaisedSortByTime': `Top in the list raised their hand first.`;
'videoCallParticipantRaisedTheirHandUp': `{name} has raised their hand up`;
'videoCallParticipantRaiseYourHand': `Raise your hand`;
'videoCallParticipantLowerYourHand': `Lower your hand`;
'videoCallPaused': `Video paused`;
'videoCallScreenShareEndConfirm': `End screen share`;
'videoCallScreenShareEndConfirmDescription': `If you minimize the window, your screen share will end.`;
Expand Down

0 comments on commit 9b25578

Please sign in to comment.