From 68fa13aabe1e2b7a821ed1e85f79f596e38c471a Mon Sep 17 00:00:00 2001 From: Jerrie-Aries <70805800+Jerrie-Aries@users.noreply.github.com> Date: Sun, 10 Jan 2021 22:23:25 +0800 Subject: [PATCH 1/4] Fix bug when sending multiple images at once. --- core/thread.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/thread.py b/core/thread.py index 75dbda5739..fcaeb025f1 100644 --- a/core/thread.py +++ b/core/thread.py @@ -915,9 +915,9 @@ async def send( additional_count = 1 for url, filename, is_sticker in images: - if not prioritize_uploads or ( - (url is None or is_image_url(url)) and not embedded_image and filename - ): + if ( + not prioritize_uploads or ((url is None or is_image_url(url)) and filename) + ) and not embedded_image: if url is not None: embed.set_image(url=url) if filename: @@ -930,7 +930,7 @@ async def send( else: embed.add_field(name="Image", value=f"[{filename}]({url})") embedded_image = True - elif filename is not None: + else: if note: color = self.bot.main_color elif from_mod: @@ -940,11 +940,11 @@ async def send( img_embed = discord.Embed(color=color) - if url is None: + if url is not None: img_embed.set_image(url=url) img_embed.url = url - - img_embed.title = filename + if filename is not None: + img_embed.title = filename img_embed.set_footer(text=f"Additional Image Upload ({additional_count})") img_embed.timestamp = message.created_at additional_images.append(destination.send(embed=img_embed)) From 8d72b79cec09ec93d8f1e8b49358907f69801761 Mon Sep 17 00:00:00 2001 From: Jerrie-Aries <70805800+Jerrie-Aries@users.noreply.github.com> Date: Sun, 10 Jan 2021 22:25:43 +0800 Subject: [PATCH 2/4] Fix error when reacting on confirm thread creation message. --- core/thread.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/thread.py b/core/thread.py index fcaeb025f1..9baa0c921c 100644 --- a/core/thread.py +++ b/core/thread.py @@ -658,7 +658,7 @@ async def delete_message( await asyncio.gather(*tasks) async def find_linked_message_from_dm(self, message, either_direction=False): - if either_direction and message.embeds: + if either_direction and message.embeds and message.embeds[0].author.url: compare_url = message.embeds[0].author.url compare_id = compare_url.split("#")[-1] else: From d19adcfab8588af2fd325d2122064e4d27885caf Mon Sep 17 00:00:00 2001 From: Jia Rong Yee <28086837+fourjr@users.noreply.github.com> Date: Mon, 11 Jan 2021 16:52:37 +0800 Subject: [PATCH 3/4] Update changelog --- CHANGELOG.md | 8 ++++++++ bot.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5db65bcb35..4407575641 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,14 @@ 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.8.1 + +### Fixed + +- Additional image uploads now render properly. ([PR #2933](https://github.com/kyb3r/modmail/pull/2933))) +- `confirm_thread_creation` no longer raises unnecessary errors. ([GH #2931](https://github.com/kyb3r/modmail/issues/2931), [PR #2933](https://github.com/kyb3r/modmail/pull/2933)) + + # v3.8.0 ### Added diff --git a/bot.py b/bot.py index 4641e2dfc2..3b2d228505 100644 --- a/bot.py +++ b/bot.py @@ -1,4 +1,4 @@ -__version__ = "3.8.0" +__version__ = "3.8.1" import asyncio From 80010ca5704f22f711060f65f97e2de50eecb62f Mon Sep 17 00:00:00 2001 From: Jia Rong Yee <28086837+fourjr@users.noreply.github.com> Date: Mon, 11 Jan 2021 16:56:31 +0800 Subject: [PATCH 4/4] Autotriggers no longer sends attachments back. resolves #2932 --- CHANGELOG.md | 1 + core/models.py | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4407575641..cf57a18a7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ however, insignificant breaking changes do not guarantee a major version bump, s - Additional image uploads now render properly. ([PR #2933](https://github.com/kyb3r/modmail/pull/2933))) - `confirm_thread_creation` no longer raises unnecessary errors. ([GH #2931](https://github.com/kyb3r/modmail/issues/2931), [PR #2933](https://github.com/kyb3r/modmail/pull/2933)) +- Autotriggers no longer sends attachments back. ([GH #2932](https://github.com/kyb3r/modmail/issues/2932)) # v3.8.0 diff --git a/core/models.py b/core/models.py index 66965a6d88..2f71f0f202 100644 --- a/core/models.py +++ b/core/models.py @@ -227,6 +227,7 @@ class DummyMessage: """ def __init__(self, message): + message.attachments = [] self._message = message def __getattr__(self, name: str):