From 0d09d179debca7210376b4ed9d0a03890b17212f Mon Sep 17 00:00:00 2001 From: Zoe Martin Date: Sun, 15 Nov 2020 16:15:44 +0100 Subject: [PATCH 1/2] Added `thread_auto_open_silently` with default 'false' to restore old functionality if desired --- CHANGELOG.md | 6 ++++++ cogs/modmail.py | 2 +- core/config.py | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 527b044301..fb0ccc854d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). This project mostly adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html); however, insignificant breaking changes do not guarantee a major version bump, see the reasoning [here](https://github.com/kyb3r/modmail/issues/319). If you're a plugin developer, note the "BREAKING" section. +# v3.7.8 + +### Added + +- Added `thread_auto_open_silently` to allow opening threads silently by default + # v3.7.7 ### Added diff --git a/cogs/modmail.py b/cogs/modmail.py index 2a47124ad8..beb647b87d 100644 --- a/cogs/modmail.py +++ b/cogs/modmail.py @@ -989,7 +989,7 @@ async def contact( if self.bot.config["dm_disabled"] in (DMDisabled.NEW_THREADS, DMDisabled.ALL_THREADS): logger.info("Contacting user %s when Modmail DM is disabled.", user) - if not silent: + if not silent and not self.bot.config.get("thread_auto_open_silently"): if ctx.author.id == user.id: description = "You have opened a Modmail thread." else: diff --git a/core/config.py b/core/config.py index 58061b8ae2..198d2bec55 100644 --- a/core/config.py +++ b/core/config.py @@ -49,6 +49,7 @@ class ConfigManager: "close_emoji": "🔒", "recipient_thread_close": False, "thread_auto_close_silently": False, + "thread_auto_open_silently": False, "thread_auto_close": isodate.Duration(), "thread_auto_close_response": "This thread has been closed automatically due to inactivity after {timeout}.", "thread_creation_response": "The staff team will get back to you as soon as possible.", From 348f6ce2bd9c33efb7c73d0de23cad2d00bcb33b Mon Sep 17 00:00:00 2001 From: Zoe Martin Date: Mon, 16 Nov 2020 14:34:07 +0100 Subject: [PATCH 2/2] Changed `thread_auto_open_silently` to `thread_creation_silent` to be more consistent with the other names and added it to config_help.json --- CHANGELOG.md | 2 +- cogs/modmail.py | 2 +- core/config.py | 2 +- core/config_help.json | 11 +++++++++++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb0ccc854d..4648482afd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ however, insignificant breaking changes do not guarantee a major version bump, s ### Added -- Added `thread_auto_open_silently` to allow opening threads silently by default +- Added `thread_creation_silent` to allow opening threads silently by default # v3.7.7 diff --git a/cogs/modmail.py b/cogs/modmail.py index beb647b87d..70b43b2046 100644 --- a/cogs/modmail.py +++ b/cogs/modmail.py @@ -989,7 +989,7 @@ async def contact( if self.bot.config["dm_disabled"] in (DMDisabled.NEW_THREADS, DMDisabled.ALL_THREADS): logger.info("Contacting user %s when Modmail DM is disabled.", user) - if not silent and not self.bot.config.get("thread_auto_open_silently"): + if not silent and not self.bot.config.get("thread_creation_silent"): if ctx.author.id == user.id: description = "You have opened a Modmail thread." else: diff --git a/core/config.py b/core/config.py index 198d2bec55..f0b18196a6 100644 --- a/core/config.py +++ b/core/config.py @@ -49,11 +49,11 @@ class ConfigManager: "close_emoji": "🔒", "recipient_thread_close": False, "thread_auto_close_silently": False, - "thread_auto_open_silently": False, "thread_auto_close": isodate.Duration(), "thread_auto_close_response": "This thread has been closed automatically due to inactivity after {timeout}.", "thread_creation_response": "The staff team will get back to you as soon as possible.", "thread_creation_footer": "Your message has been sent", + "thread_creation_silent": False, "thread_self_closable_creation_footer": "Click the lock to close the thread", "thread_creation_title": "Thread Created", "thread_close_footer": "Replying will create a new thread", diff --git a/core/config_help.json b/core/config_help.json index f935e8657c..da51149791 100644 --- a/core/config_help.json +++ b/core/config_help.json @@ -303,6 +303,17 @@ "See also: `thread_creation_title`, `thread_creation_response`, `thread_self_closable_creation_footer`, `thread_close_footer`." ] }, + "thread_creation_silent": { + "default": "No", + "description": "Setting this configuration will open a new thread silently by default.", + "examples": [ + "`{prefix}config set thread_creation_silent yes`", + "`{prefix}config set thread_creation_silent no`" + ], + "notes": [ + "Works like `{prefix}contact silent` for every new thread." + ] + }, "thread_self_closable_creation_footer": { "default": "\"Click the lock to close the thread\"", "description": "This is the message embed footer sent to the recipient upon the creation of a new thread.",