]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/profilenoticestream.php
Only get POST verbs for noticestreams for now
[quix0rs-gnu-social.git] / lib / profilenoticestream.php
index f7154a52be9563ae3bc90551ee370838ae84771d..a59a5d848b8ce06429e2a173e1b48a66260ea919 100644 (file)
@@ -62,7 +62,7 @@ class ProfileNoticeStream extends ScopingNoticeStream
                             $userProfile);
     }
 
-    function getNoticeIds($offset, $limit, $since_id, $max_id)
+    function getNoticeIds($offset, $limit, $since_id=null, $max_id=null)
     {
         if ($this->impossibleStream()) {
             return array();
@@ -71,18 +71,18 @@ class ProfileNoticeStream extends ScopingNoticeStream
         }
     }
 
-    function getNotices($offset, $limit, $sinceId = null, $maxId = null)
+    function getNotices($offset, $limit, $since_id=null, $max_id=null)
     {
         if ($this->impossibleStream()) {
             return new ArrayWrapper(array());
         } else {
-            return parent::getNotices($offset, $limit, $sinceId, $maxId);
+            return parent::getNotices($offset, $limit, $since_id, $max_id);
         }
     }
 
     function impossibleStream() 
     {
-        $user = User::staticGet('id', $this->streamProfile->id);
+        $user = User::getKV('id', $this->streamProfile->id);
 
         // If it's a private stream, and no user or not a subscriber
 
@@ -136,6 +136,12 @@ class RawProfileNoticeStream extends NoticeStream
         Notice::addWhereSinceId($notice, $since_id);
         Notice::addWhereMaxId($notice, $max_id);
 
+        if (!$this->allVerbs) {
+            $notice->whereAdd(sprintf('verb="%s" OR verb="%s"',
+                                      ActivityVerb::POST,
+                                      ActivityUtils::resolveUri(ActivityVerb::POST, true)));
+        }
+
         $notice->orderBy('created DESC, id DESC');
 
         if (!is_null($offset)) {