pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/chatwoot/chatwoot/pull/13685/files

ttps://github.githubassets.com/assets/primer-primitives-6da842159062d25e.css" /> feat: Show error when deleting messages on unsupported channels by joao-baza · Pull Request #13685 · chatwoot/chatwoot · GitHub
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions app/javascript/dashboard/components-next/message/Message.vue
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,15 @@ const payloadForContextMenu = computed(() => {
};
});

// Only Chatwoot-native channels support real message deletion at this moment.
const CHANNELS_WITH_DELETE_SUPPORT = ['Channel::WebWidget', 'Channel::Api'];

const canDeleteOnChannel = computed(() => {
if (props.private) return true;
const channelType = inbox.value?.channel_type;
return CHANNELS_WITH_DELETE_SUPPORT.includes(channelType);
});
Comment on lines +370 to +374

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Allow private notes to bypass channel delete restriction

This gate is computed only from inbox.channel_type, so in non-WebWidget/API inboxes it blocks deletion for every message type, including internal private notes. Private notes (private: true) are Chatwoot-only content and do not depend on external channel delete APIs, so agents can no longer delete their own notes in WhatsApp/Telegram/Facebook conversations even though backend messages#destroy still supports it.

Useful? React with 👍 / 👎.


const contextMenuEnabledOptions = computed(() => {
const hasText = !!props.content;
const hasAttachments = !!(props.attachments && props.attachments.length > 0);
Expand Down Expand Up @@ -578,6 +587,7 @@ provideMessageContext({
:is-open="showContextMenu"
:enabled-options="contextMenuEnabledOptions"
:message="payloadForContextMenu"
:can-delete-on-channel="canDeleteOnChannel"
hide-button
@open="openContextMenu"
@close="closeContextMenu"
Expand Down
3 changes: 2 additions & 1 deletion app/javascript/dashboard/i18n/locale/en/conversation.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"UNSUPPORTED_MESSAGE_TIKTOK": "This message is unsupported. You can view this message on the TikTok app.",
"SUCCESS_DELETE_MESSAGE": "Message deleted successfully",
"FAIL_DELETE_MESSSAGE": "Couldn't delete message! Try again",
"DELETE_NOT_SUPPORTED": "This inbox does not support message deletion",
"NO_RESPONSE": "No response",
"RESPONSE": "Response",
"RATING_TITLE": "Rating",
Expand Down Expand Up @@ -449,4 +450,4 @@
"GALLERY_VIEW": {
"ERROR_DOWNLOADING": "Unable to download attachment. Please try again"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ export default {
type: Boolean,
default: false,
},
canDeleteOnChannel: {
type: Boolean,
default: true,
},
},
emits: ['open', 'close', 'replyTo'],
setup() {
Expand Down Expand Up @@ -134,6 +138,11 @@ export default {
this.handleClose();
},
openDeleteModal() {
if (!this.canDeleteOnChannel) {
useAlert(this.$t('CONVERSATION.DELETE_NOT_SUPPORTED'));
this.handleClose();
return;
}
this.handleClose();
this.showDeleteModal = true;
},
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy