MessageLogger: Add setting to toggle deleted attachments logging (#4556)

Co-authored-by: V <vendicated@riseup.net>
This commit is contained in:
sadan 2026-08-26 20:02:21 -04:00 • committed by GitHub
parent ada5cfeb80
commit ce4e84277e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -81,6 +81,12 @@ const settings = definePluginSettings({
description: "Whether to log edited messages",
default: true,
},
logDeletedAttachments: {
type: OptionType.BOOLEAN,
description: "Whether to log deleted attachments",
default: true,
restartNeeded: true,
},
inlineEdits: {
type: OptionType.BOOLEAN,
description: "Whether to display edit history as part of message content",
@ -89,7 +95,7 @@ const settings = definePluginSettings({
ignoreBots: {
type: OptionType.BOOLEAN,
description: "Whether to ignore messages by bots",
default: false
default: true
},
ignoreSelf: {
type: OptionType.BOOLEAN,
@ -482,6 +488,7 @@ export default definePlugin({
// just mark deleted attachments as deleted on MESSAGE_UPDATE
{
match: /attachments:(\i)\.attachments\?\?\[\],/,
predicate: () => settings.store.logDeletedAttachments,
replace: "attachments: $self.handleUpdateAttachments($1),"
}
]