Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
fourjr committed Jan 11, 2021
2 parents 35f24ee + 80010ca commit bdbebff
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ 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))
- Autotriggers no longer sends attachments back. ([GH #2932](https://github.com/kyb3r/modmail/issues/2932))


# v3.8.0

### Added
Expand Down
2 changes: 1 addition & 1 deletion bot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "3.8.0"
__version__ = "3.8.1"


import asyncio
Expand Down
1 change: 1 addition & 0 deletions core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ class DummyMessage:
"""

def __init__(self, message):
message.attachments = []
self._message = message

def __getattr__(self, name: str):
Expand Down
16 changes: 8 additions & 8 deletions core/thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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))
Expand Down

0 comments on commit bdbebff

Please sign in to comment.