summaryrefslogtreecommitdiffstats
path: root/lib/Db/NotesRequest.php
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2018-12-04 22:49:17 -0100
committerJulius Härtl <jus@bitgrid.net>2018-12-05 09:53:23 +0100
commit1248d3fc8089cbb582a1a651cfb84bbf764ac210 (patch)
tree04755040b3ce832b84bb8cc715f6b843a6a4e148 /lib/Db/NotesRequest.php
parent374f31210238b537715faf5f74bd7f4f4a073202 (diff)
limit on Accepted followers
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib/Db/NotesRequest.php')
-rw-r--r--lib/Db/NotesRequest.php32
1 files changed, 22 insertions, 10 deletions
diff --git a/lib/Db/NotesRequest.php b/lib/Db/NotesRequest.php
index 36e3e930..cc3fd342 100644
--- a/lib/Db/NotesRequest.php
+++ b/lib/Db/NotesRequest.php
@@ -156,17 +156,22 @@ class NotesRequest extends NotesRequestBuilder {
/**
+ * Should returns:
+ * * Own posts,
+ * * Followed accounts
+ *
* @param string $actorId
* @param int $since
* @param int $limit
*
* @return array
*/
- public function getHomeNotesForActorId(string $actorId, int $since = 0, int $limit = 5): array {
+ public function getStreamHome(string $actorId, int $since = 0, int $limit = 5): array {
$qb = $this->getNotesSelectSql();
$this->rightJoinFollowing($qb);
$this->limitToActorId($qb, $actorId, 'f');
+ $this->limitToAccepted($qb, true, 'f');
$qb->orWhere($this->exprLimitToDBField($qb, 'attributed_to', $actorId));
$this->limitPaginate($qb, $since, $limit);
@@ -184,19 +189,20 @@ class NotesRequest extends NotesRequestBuilder {
/**
+ * Should returns:
+ * * Private message.
+ * - group messages.
+
+ * @param string $actorId
* @param int $since
* @param int $limit
- * @param bool $localOnly
*
* @return array
*/
- public function getPublicNotes(int $since = 0, int $limit = 5, bool $localOnly = true): array {
+ public function getStreamDirect(string $actorId, int $since = 0, int $limit = 5): array {
$qb = $this->getNotesSelectSql();
- $this->limitToRecipient($qb, ActivityService::TO_PUBLIC);
+ $this->limitToRecipient($qb, $actorId, true);
$this->limitPaginate($qb, $since, $limit);
- if ($localOnly) {
- $this->limitToLocal($qb, true);
- }
$this->leftJoinCacheActors($qb, 'attributed_to');
$notes = [];
@@ -211,17 +217,23 @@ class NotesRequest extends NotesRequestBuilder {
/**
- * @param string $actorId
+ * Should returns:
+ * - All local public/federated posts
+ *
* @param int $since
* @param int $limit
+ * @param bool $localOnly
*
* @return array
*/
- public function getDirectNotesForActorId(string $actorId, int $since = 0, int $limit = 5
+ public function getStreamTimeline(int $since = 0, int $limit = 5, bool $localOnly = true
): array {
$qb = $this->getNotesSelectSql();
- $this->limitToRecipient($qb, $actorId, true);
+ $this->limitToRecipient($qb, ActivityService::TO_PUBLIC);
$this->limitPaginate($qb, $since, $limit);
+ if ($localOnly) {
+ $this->limitToLocal($qb, true);
+ }
$this->leftJoinCacheActors($qb, 'attributed_to');
$notes = [];