From 63c8a908804bb019898732af972d04f286eec041 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 2 Sep 2023 13:14:54 +0000 Subject: [PATCH] "For you" now respects the "notify new posts" setting --- src/Module/Conversation/Channel.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Module/Conversation/Channel.php b/src/Module/Conversation/Channel.php index 03c3d0f174..230a9ee8ae 100644 --- a/src/Module/Conversation/Channel.php +++ b/src/Module/Conversation/Channel.php @@ -245,8 +245,11 @@ class Channel extends BaseModule } elseif (self::$content == self::FORYOU) { $cid = Contact::getPublicIdByUserId(DI::userSession()->getLocalUserId()); - $condition = ["(`author-id` IN (SELECT `relation-cid` FROM `contact-relation` WHERE `cid` = ? AND `thread-score` > ?) OR (`comments` >= ? AND `author-id` IN (SELECT `pid` FROM `account-user-view` WHERE `uid` = ? AND `rel` IN (?, ?))))", - $cid, self::getMedianThreadScore($cid, 4), self::getMedianComments(3), DI::userSession()->getLocalUserId(), Contact::FRIEND, Contact::SHARING]; + $condition = ["(`author-id` IN (SELECT `relation-cid` FROM `contact-relation` WHERE `cid` = ? AND `thread-score` > ?) OR + (`comments` >= ? AND `author-id` IN (SELECT `pid` FROM `account-user-view` WHERE `uid` = ? AND `rel` IN (?, ?))) OR + ( `author-id` IN (SELECT `pid` FROM `account-user-view` WHERE `uid` = ? AND `rel` IN (?, ?) AND `notify_new_posts`)))", + $cid, self::getMedianThreadScore($cid, 4), self::getMedianComments(3), DI::userSession()->getLocalUserId(), Contact::FRIEND, Contact::SHARING, + DI::userSession()->getLocalUserId(), Contact::FRIEND, Contact::SHARING]; } elseif (self::$content == self::FOLLOWERS) { $condition = ["`author-id` IN (SELECT `pid` FROM `account-user-view` WHERE `uid` = ? AND `rel` = ?)", DI::userSession()->getLocalUserId(), Contact::FOLLOWER]; }