[DirectMessage] Update inboxMessages() to stop fetching replies
This is yet to be supported in the plugin.
This commit is contained in:
parent
58d7ab4d13
commit
8b0abc0382
@ -72,24 +72,14 @@ class MessageModel
|
|||||||
*/
|
*/
|
||||||
public static function inboxMessages(User $to, ?int $page = null)
|
public static function inboxMessages(User $to, ?int $page = null)
|
||||||
{
|
{
|
||||||
|
// fetch all notice IDs related to the user $to
|
||||||
$attention = new Attention();
|
$attention = new Attention();
|
||||||
$attention->selectAdd('notice_id');
|
$attention->selectAdd('notice_id');
|
||||||
$attention->whereAdd('profile_id = ' . $to->getID());
|
$attention->whereAdd('profile_id = ' . $to->getID());
|
||||||
|
|
||||||
$ids = $attention->find() ? $attention->fetchAll('notice_id') : [];
|
$ids = $attention->find() ? $attention->fetchAll('notice_id') : [];
|
||||||
|
|
||||||
$reply = new Reply();
|
// get the messages
|
||||||
$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;
|
|
||||||
}
|
|
||||||
|
|
||||||
$message = new Notice();
|
$message = new Notice();
|
||||||
|
|
||||||
$message->whereAdd('scope = ' . NOTICE::MESSAGE_SCOPE);
|
$message->whereAdd('scope = ' . NOTICE::MESSAGE_SCOPE);
|
||||||
|
Loading…
Reference in New Issue
Block a user