Clarify function of "Delete" option when deleting conversation messages
This commit is contained in:
parent
edd6ed5fab
commit
fcf2c0a3f0
7 changed files with 20 additions and 29 deletions
|
@ -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",
|
||||
|
|
|
@ -424,7 +424,7 @@ export class ConversationHeader extends React.Component<PropsType, StateType> {
|
|||
this.setState({ hasDeleteMessagesConfirmation: true })
|
||||
}
|
||||
>
|
||||
{i18n('icu:deleteMessages')}
|
||||
{i18n('icu:deleteMessagesInConversation')}
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
);
|
||||
|
@ -553,7 +553,7 @@ export class ConversationHeader extends React.Component<PropsType, StateType> {
|
|||
<MenuItem
|
||||
onClick={() => this.setState({ hasDeleteMessagesConfirmation: true })}
|
||||
>
|
||||
{i18n('icu:deleteMessages')}
|
||||
{i18n('icu:deleteMessagesInConversation')}
|
||||
</MenuItem>
|
||||
{isGroup && (
|
||||
<MenuItem
|
||||
|
@ -589,7 +589,7 @@ export class ConversationHeader extends React.Component<PropsType, StateType> {
|
|||
<ConfirmationDialog
|
||||
dialogName="ConversationHeader.destroyMessages"
|
||||
title={i18n(
|
||||
'icu:ConversationHeader__DeleteMessagesConfirmation__title'
|
||||
'icu:ConversationHeader__DeleteMessagesInConversationConfirmation__title'
|
||||
)}
|
||||
actions={[
|
||||
{
|
||||
|
@ -607,7 +607,7 @@ export class ConversationHeader extends React.Component<PropsType, StateType> {
|
|||
}}
|
||||
>
|
||||
{i18n(
|
||||
'icu:ConversationHeader__DeleteMessagesConfirmation__description'
|
||||
'icu:ConversationHeader__DeleteMessagesInConversationConfirmation__description'
|
||||
)}
|
||||
</ConfirmationDialog>
|
||||
);
|
||||
|
|
1
ts/model-types.d.ts
vendored
1
ts/model-types.d.ts
vendored
|
@ -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
|
||||
|
|
|
@ -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, {
|
||||
|
|
|
@ -250,7 +250,6 @@ export type ConversationType = ReadonlyDeep<
|
|||
customColorId?: string;
|
||||
discoveredUnregisteredAt?: number;
|
||||
hideStory?: boolean;
|
||||
hiddenFromConversationSearch?: boolean;
|
||||
isArchived?: boolean;
|
||||
isBlocked?: boolean;
|
||||
removalStage?: 'justNotification' | 'messageRequest';
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue