From d50f1471eb768edcee37a69dcd699c9bf7741579 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Thu, 6 Feb 2025 01:36:02 -0500 Subject: [PATCH] fix #2215 Hide the message-redaction capability if allow-individual-delete is disabled. (Technically REDACT can still be used, but only by ircops, so advertising it is misleading in the most common case). --- irc/config.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/irc/config.go b/irc/config.go index 4bbde6ee..a4b1fb6b 100644 --- a/irc/config.go +++ b/irc/config.go @@ -1530,6 +1530,7 @@ func LoadConfig(filename string) (config *Config, err error) { config.Server.supportedCaps.Disable(caps.Chathistory) config.Server.supportedCaps.Disable(caps.EventPlayback) config.Server.supportedCaps.Disable(caps.ZNCPlayback) + config.Server.supportedCaps.Disable(caps.MessageRedaction) } if !config.History.Enabled || !config.History.Persistent.Enabled { @@ -1560,6 +1561,10 @@ func LoadConfig(filename string) (config *Config, err error) { } } + if !config.History.Retention.AllowIndividualDelete { + config.Server.supportedCaps.Disable(caps.MessageRedaction) // #2215 + } + config.Roleplay.addSuffix = utils.BoolDefaultTrue(config.Roleplay.AddSuffix) config.Datastore.MySQL.ExpireTime = time.Duration(config.History.Restrictions.ExpireTime)