Skip to content

Commit

Permalink
Changelog & Ghost errors are no longer raised when threads are create…
Browse files Browse the repository at this point in the history
…d using non-organic methods.
  • Loading branch information
fourjr committed Mar 19, 2021
1 parent 6b26e30 commit 9d4813d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ however, insignificant breaking changes do not guarantee a major version bump, s

- `on_thread_initiate` and `on_thread_ready` events now have `thread, creator, category, initial_message` as additional arguments.

### Fixed

- `confirm_thread_creation` now properly works when a user opens a thread using react to contact. ([GH #2930](https://github.com/kyb3r/modmail/issues/2930), [PR #2971](https://github.com/kyb3r/modmail/pull/2971))
- `?disable all/new` now disables react to contact threads. ([GH #2969](https://github.com/kyb3r/modmail/issues/2969), [PR #2971](https://github.com/kyb3r/modmail/pull/2971))
- Ghost errors are no longer raised when threads are created using non-organic methods.

### Internal

- `thread.reply` now returns (msg_to_user, msg_to_thread). Can be useful in plugins.
Expand Down
3 changes: 2 additions & 1 deletion core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ class DummyMessage:
"""

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

def __getattr__(self, name: str):
Expand Down
4 changes: 2 additions & 2 deletions core/thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ class Author:
await self.bot.api.update_note_ids(ids)

async def activate_auto_triggers():
message = DummyMessage(copy.copy(initial_message))
if message:
if initial_message:
message = DummyMessage(copy.copy(initial_message))
try:
return await self.bot.trigger_auto_triggers(message, channel)
except RuntimeError:
Expand Down

0 comments on commit 9d4813d

Please sign in to comment.