summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2020-10-11 23:35:14 -0100
committerGitHub <noreply@github.com>2020-10-11 23:35:14 -0100
commite6a6fe7b77c0d591e6722198b6bd1c3a79ce14a2 (patch)
treef2dc1563376a3677c394c1d6640a85bac9663483
parent2748b0e46a371616e51c74f7704081832ba1917b (diff)
parent931c1d8ba8f5c0797eba37f2fef6643389aa6059 (diff)
Merge pull request #1054 from nextcloud/self-profile-show-all
show all activity when viewing your own profile, not just public acti…
-rw-r--r--lib/Db/SocialLimitsQueryBuilder.php4
-rw-r--r--lib/Db/StreamRequest.php3
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/Db/SocialLimitsQueryBuilder.php b/lib/Db/SocialLimitsQueryBuilder.php
index d3249fc7..d3a4ff47 100644
--- a/lib/Db/SocialLimitsQueryBuilder.php
+++ b/lib/Db/SocialLimitsQueryBuilder.php
@@ -408,7 +408,9 @@ class SocialLimitsQueryBuilder extends SocialCrossQueryBuilder {
$andX = $expr->andX();
$andX->add($expr->eq($alias . '.stream_id', $this->getDefaultSelectAlias() . '.id_prim'));
- $andX->add($this->exprLimitToDBField('actor_id', $this->prim($actorId), true, true, $alias));
+ if ($actorId) {
+ $andX->add($this->exprLimitToDBField('actor_id', $this->prim($actorId), true, true, $alias));
+ }
$andX->add($this->exprLimitToDBField('type', $type, true, true, $alias));
if ($subType !== '') {
diff --git a/lib/Db/StreamRequest.php b/lib/Db/StreamRequest.php
index 1e40fbdb..f9d86249 100644
--- a/lib/Db/StreamRequest.php
+++ b/lib/Db/StreamRequest.php
@@ -489,7 +489,8 @@ class StreamRequest extends StreamRequestBuilder {
$qb->selectDestFollowing('sd', '');
$qb->innerJoinSteamDest('recipient', 'id_prim', 'sd', 's');
- $qb->limitToDest(ACore::CONTEXT_PUBLIC, 'recipient', '', 'sd');
+ $accountIsViewer = ($qb->hasViewer()) ? ($qb->getViewer()->getId() === $actorId) : false;
+ $qb->limitToDest($accountIsViewer ? '' : ACore::CONTEXT_PUBLIC, 'recipient', '', 'sd');
$qb->linkToCacheActors('ca', 's.attributed_to_prim');
$qb->leftJoinStreamAction();