]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/publicnoticestream.php
Merge branch 'nightly' into 'nightly'
[quix0rs-gnu-social.git] / lib / publicnoticestream.php
index 19d0ad96a0c783a1d124e2fd0483fbba178b6f4c..757c2164c08fc69af8e00bb9a24418d4b13899ec 100644 (file)
@@ -47,10 +47,11 @@ if (!defined('STATUSNET')) {
 
 class PublicNoticeStream extends ScopingNoticeStream
 {
-    function __construct()
+    function __construct($profile=null)
     {
         parent::__construct(new CachingNoticeStream(new RawPublicNoticeStream(),
-                                                    'public'));
+                                                    'public'),
+                            $profile);
     }
 }
 
@@ -67,7 +68,7 @@ class PublicNoticeStream extends ScopingNoticeStream
 
 class RawPublicNoticeStream extends NoticeStream
 {
-    function getNoticeIds($offset=0, $limit=20, $since_id=0, $max_id=0)
+    function getNoticeIds($offset, $limit, $since_id, $max_id)
     {
         $notice = new Notice();
 
@@ -80,17 +81,16 @@ class RawPublicNoticeStream extends NoticeStream
             $notice->limit($offset, $limit);
         }
 
-        if (common_config('public', 'localonly')) {
-            $notice->whereAdd('is_local = ' . Notice::LOCAL_PUBLIC);
-        } else {
-            // -1 == blacklisted, -2 == gateway (i.e. Twitter)
-            $notice->whereAdd('is_local !='. Notice::LOCAL_NONPUBLIC);
-            $notice->whereAdd('is_local !='. Notice::GATEWAY);
-        }
+        // This feed always gives only local activities.
+        $notice->whereAdd('is_local = ' . Notice::LOCAL_PUBLIC);
 
         Notice::addWhereSinceId($notice, $since_id);
         Notice::addWhereMaxId($notice, $max_id);
 
+        if (!empty($this->selectVerbs)) {
+            $notice->whereAddIn('verb', $this->selectVerbs, $notice->columnType('verb'));
+        }
+
         $ids = array();
 
         if ($notice->find()) {
@@ -104,4 +104,4 @@ class RawPublicNoticeStream extends NoticeStream
 
         return $ids;
     }
-}
\ No newline at end of file
+}