mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-21 21:30:08 +00:00
Gracefully handle deleted messages in MessageAttachmentObjectType
This commit is contained in:
parent
4579696576
commit
ac4178bd36
2
LICENSE
2
LICENSE
@ -10,7 +10,7 @@ Additional Use Grant: You may use the Licensed Work when your application
|
||||
uses the Licensed Work for a purpose that does neither
|
||||
directly or indirectly generate revenue.
|
||||
|
||||
Change Date: 2027-02-02
|
||||
Change Date: 2027-02-22
|
||||
|
||||
Change License: Version 2 or later of the GNU General Public License as
|
||||
published by the Free Software Foundation.
|
||||
|
@ -1,12 +1,12 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (c) 2010-2022 Tim Düsterhus.
|
||||
* Copyright (c) 2010-2023 Tim Düsterhus.
|
||||
*
|
||||
* Use of this software is governed by the Business Source License
|
||||
* included in the LICENSE file.
|
||||
*
|
||||
* Change Date: 2026-09-17
|
||||
* Change Date: 2027-02-22
|
||||
*
|
||||
* On the date above, in accordance with the Business Source
|
||||
* License, use of this software will be governed by version 2
|
||||
@ -35,6 +35,10 @@ public function canDownload($objectID): bool
|
||||
if ($objectID) {
|
||||
$message = new Message($objectID);
|
||||
|
||||
if (!$message->messageID) {
|
||||
return false;
|
||||
}
|
||||
|
||||
\assert($message->getMessageType()->objectType === 'be.bastelstu.chat.messageType.attachment');
|
||||
$room = $message->getRoom();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user