diff options
Diffstat (limited to 'lib/Db/SocialLimitsQueryBuilder.php')
-rw-r--r-- | lib/Db/SocialLimitsQueryBuilder.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/Db/SocialLimitsQueryBuilder.php b/lib/Db/SocialLimitsQueryBuilder.php index a82cddb3..c1dc173e 100644 --- a/lib/Db/SocialLimitsQueryBuilder.php +++ b/lib/Db/SocialLimitsQueryBuilder.php @@ -381,9 +381,12 @@ class SocialLimitsQueryBuilder extends SocialCrossQueryBuilder { /** * @param string $aliasDest * @param string $aliasFollowing - * @param bool $public + * @param bool $allowPublic + * @param bool $allowDirect */ - public function limitToViewer(string $aliasDest = 'sd', string $aliasFollowing = 'f', bool $public = false + public function limitToViewer( + string $aliasDest = 'sd', string $aliasFollowing = 'f', bool $allowPublic = false, + bool $allowDirect = false ) { if (!$this->hasViewer()) { $this->selectDestFollowing($aliasDest); @@ -403,10 +406,14 @@ class SocialLimitsQueryBuilder extends SocialCrossQueryBuilder { ); $orX->add($following); - if ($public) { + if ($allowPublic) { $orX->add($this->exprLimitToDest(ACore::CONTEXT_PUBLIC, 'recipient', '', $aliasDest)); } + if ($allowDirect) { + $orX->add($this->exprLimitToDest($actor->getId(), 'dm', '', $aliasDest)); + } + $this->andWhere($orX); } |