From 83df8848c8d11ab7deb7175c8165ba41df9b0ca7 Mon Sep 17 00:00:00 2001 From: t3nma Date: Tue, 28 Jul 2020 05:48:43 +0100 Subject: [PATCH] [DirectMessage] Update inboxMessages() to stop fetching replies This is yet to be supported in the plugin. --- plugins/DirectMessage/lib/models/MessageModel.php | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/plugins/DirectMessage/lib/models/MessageModel.php b/plugins/DirectMessage/lib/models/MessageModel.php index 4a1de82fd6..4ad05bc7b6 100644 --- a/plugins/DirectMessage/lib/models/MessageModel.php +++ b/plugins/DirectMessage/lib/models/MessageModel.php @@ -72,24 +72,14 @@ class MessageModel */ public static function inboxMessages(User $to, ?int $page = null) { + // fetch all notice IDs related to the user $to $attention = new Attention(); $attention->selectAdd('notice_id'); $attention->whereAdd('profile_id = ' . $to->getID()); $ids = $attention->find() ? $attention->fetchAll('notice_id') : []; - $reply = new Reply(); - $reply->selectAdd('notice_id'); - $reply->whereAdd('profile_id = ' . $to->getID()); - - if ($reply->find()) { - $ids = array_unique( - array_merge($ids, $reply->fetchAll('notice_id')) - ); - } else if (empty($ids)) { - return null; - } - + // get the messages $message = new Notice(); $message->whereAdd('scope = ' . NOTICE::MESSAGE_SCOPE);