diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 7a960d42d41..8300ddaffbf 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1387,15 +1387,27 @@ }, "icu:deleteMessages": { "messageformat": "Delete", - "description": "Menu item for deleting messages, title case." + "description": "(deleted 2023/10/26) Menu item for deleting messages, title case." + }, + "icu:deleteMessagesInConversation": { + "messageformat": "Delete messages", + "description": "Menu item for deleting all messages in a conversation from your device" }, "icu:ConversationHeader__DeleteMessagesConfirmation__title": { "messageformat": "Delete chat?", - "description": "Conversation Header > Delete Action > Delete Messages Confirmation Modal > Title" + "description": "(deleted 2023/10/26) Conversation Header > Delete Action > Delete Messages Confirmation Modal > Title" + }, + "icu:ConversationHeader__DeleteMessagesInConversationConfirmation__title": { + "messageformat": "Delete messages?", + "description": "Title for confirmation modal to delete all messages in a conversation" }, "icu:ConversationHeader__DeleteMessagesConfirmation__description": { "messageformat": "This chat will be deleted from this device.", - "description": "Conversation Header > Delete Action > Delete Messages Confirmation Modal > Description" + "description": "(deleted 2023/10/26) Conversation Header > Delete Action > Delete Messages Confirmation Modal > Description" + }, + "icu:ConversationHeader__DeleteMessagesInConversationConfirmation__description": { + "messageformat": "Messages in this chat will be deleted from this device. You can still search for this chat after you delete messages.", + "description": "Description for confirmation modal to delete all messages in a conversation" }, "icu:ConversationHeader__ContextMenu__LeaveGroupAction__title": { "messageformat": "Leave group", diff --git a/ts/components/conversation/ConversationHeader.tsx b/ts/components/conversation/ConversationHeader.tsx index 53ff10f6bf6..ff1e2590cc3 100644 --- a/ts/components/conversation/ConversationHeader.tsx +++ b/ts/components/conversation/ConversationHeader.tsx @@ -424,7 +424,7 @@ export class ConversationHeader extends React.Component { this.setState({ hasDeleteMessagesConfirmation: true }) } > - {i18n('icu:deleteMessages')} + {i18n('icu:deleteMessagesInConversation')} ); @@ -553,7 +553,7 @@ export class ConversationHeader extends React.Component { this.setState({ hasDeleteMessagesConfirmation: true })} > - {i18n('icu:deleteMessages')} + {i18n('icu:deleteMessagesInConversation')} {isGroup && ( { { }} > {i18n( - 'icu:ConversationHeader__DeleteMessagesConfirmation__description' + 'icu:ConversationHeader__DeleteMessagesInConversationConfirmation__description' )} ); diff --git a/ts/model-types.d.ts b/ts/model-types.d.ts index b0320ecb532..007e5721738 100644 --- a/ts/model-types.d.ts +++ b/ts/model-types.d.ts @@ -310,7 +310,6 @@ export type ConversationAttributesType = { draftBodyRanges?: DraftBodyRanges; draftTimestamp?: number | null; hideStory?: boolean; - hiddenFromConversationSearch?: boolean; inbox_position?: number; // When contact is removed - it is initially placed into `justNotification` // removal stage. In this stage user can still send messages (which will diff --git a/ts/models/conversations.ts b/ts/models/conversations.ts index 83f7fdfd96e..1a6f7b0d09c 100644 --- a/ts/models/conversations.ts +++ b/ts/models/conversations.ts @@ -371,8 +371,6 @@ export class ConversationModel extends window.Backbone this.unset('tokens'); this.on('change:members change:membersV2', this.fetchContacts); - this.on('change:isArchived', this.onArchiveChange); - this.typingRefreshTimer = null; this.typingPauseTimer = null; @@ -4141,17 +4139,6 @@ export class ConversationModel extends window.Backbone } } - private onArchiveChange() { - const isArchived = this.get('isArchived'); - if (isArchived) { - return; - } - if (!this.get('hiddenFromConversationSearch')) { - return; - } - this.set('hiddenFromConversationSearch', false); - } - setMarkedUnread(markedUnread: boolean): void { const previousMarkedUnread = this.get('markedUnread'); @@ -4855,9 +4842,6 @@ export class ConversationModel extends window.Backbone active_at: null, pendingUniversalTimer: undefined, }); - if (isGroup(this.attributes)) { - this.set('hiddenFromConversationSearch', true); - } window.Signal.Data.updateConversation(this.attributes); await window.Signal.Data.removeAllMessagesInConversation(this.id, { diff --git a/ts/state/ducks/conversations.ts b/ts/state/ducks/conversations.ts index 318149551fc..a24175f966e 100644 --- a/ts/state/ducks/conversations.ts +++ b/ts/state/ducks/conversations.ts @@ -250,7 +250,6 @@ export type ConversationType = ReadonlyDeep< customColorId?: string; discoveredUnregisteredAt?: number; hideStory?: boolean; - hiddenFromConversationSearch?: boolean; isArchived?: boolean; isBlocked?: boolean; removalStage?: 'justNotification' | 'messageRequest'; diff --git a/ts/util/filterAndSortConversations.ts b/ts/util/filterAndSortConversations.ts index e5994c23fa2..f1e505d8767 100644 --- a/ts/util/filterAndSortConversations.ts +++ b/ts/util/filterAndSortConversations.ts @@ -106,7 +106,7 @@ function searchConversations( const phoneNumber = parseAndFormatPhoneNumber(searchTerm, regionCode); const currentConversations = conversations.filter(conversation => { - return !conversation.left && !conversation.hiddenFromConversationSearch; + return !conversation.left; }); // Escape the search term diff --git a/ts/util/getConversation.ts b/ts/util/getConversation.ts index 4b3dd4b0355..50ced406988 100644 --- a/ts/util/getConversation.ts +++ b/ts/util/getConversation.ts @@ -177,9 +177,6 @@ export function getConversation(model: ConversationModel): ConversationType { groupId: attributes.groupId, groupLink: buildGroupLink(attributes), hideStory: Boolean(attributes.hideStory), - hiddenFromConversationSearch: Boolean( - attributes.hiddenFromConversationSearch - ), inboxPosition, isArchived: attributes.isArchived, isBlocked: isBlocked(attributes),