aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorfawn <fawn@envs.net>2023-05-31 19:00:15 +0300
committerV <vendicated@riseup.net>2023-05-31 19:14:17 +0200
commit4abcea61f8dc161af9ecc9821e570d7ddf59ba35 (patch)
treea59fda37a3508a2bca1f050941ded5feb9daa80b /src/plugins
parentcba810cab582065b16d965e72a5f54d858080ab0 (diff)
downloadVencord-4abcea61f8dc161af9ecc9821e570d7ddf59ba35.tar.gz
Vencord-4abcea61f8dc161af9ecc9821e570d7ddf59ba35.tar.bz2
Vencord-4abcea61f8dc161af9ecc9821e570d7ddf59ba35.zip
feat(MessageClickAction): delete message logger history (#1204)
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/messageClickActions.ts13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/plugins/messageClickActions.ts b/src/plugins/messageClickActions.ts
index 28c558e..5fd6a49 100644
--- a/src/plugins/messageClickActions.ts
+++ b/src/plugins/messageClickActions.ts
@@ -67,7 +67,7 @@ export default definePlugin({
document.addEventListener("keydown", keydown);
document.addEventListener("keyup", keyup);
- this.onClick = addClickListener((msg, channel, event) => {
+ this.onClick = addClickListener((msg: any, channel, event) => {
const isMe = msg.author.id === UserStore.getCurrentUser().id;
if (!isDeletePressed) {
if (event.detail < 2) return;
@@ -90,7 +90,16 @@ export default definePlugin({
});
}
} else if (settings.store.enableDeleteOnClick && (isMe || PermissionStore.can(MANAGE_CHANNELS, channel))) {
- MessageActions.deleteMessage(channel.id, msg.id);
+ if (msg.deleted) {
+ FluxDispatcher.dispatch({
+ type: "MESSAGE_DELETE",
+ channelId: channel.id,
+ id: msg.id,
+ mlDeleted: true
+ });
+ } else {
+ MessageActions.deleteMessage(channel.id, msg.id);
+ }
event.preventDefault();
}
});