]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/publicnoticestream.php
Merge remote-tracking branch 'upstream/nightly' into nightly
[quix0rs-gnu-social.git] / lib / publicnoticestream.php
index 222eead0efb1c940db610388f5392c0684763d45..2638292714fda2cc359f773dd556b5f840a4f404 100644 (file)
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET')) {
-    // This check helps protect against security problems;
-    // your code file can't be executed directly from the web.
-    exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 /**
  * Public stream
@@ -45,13 +41,13 @@ if (!defined('STATUSNET')) {
  * @link      http://status.net/
  */
 
-class PublicNoticeStream extends ScopingNoticeStream
+class PublicNoticeStream extends ModeratedNoticeStream
 {
-    function __construct($profile=null)
+    function __construct(Profile $scoped=null)
     {
         parent::__construct(new CachingNoticeStream(new RawPublicNoticeStream(),
                                                     'public'),
-                            $profile);
+                            $scoped);
     }
 }
 
@@ -66,7 +62,7 @@ class PublicNoticeStream extends ScopingNoticeStream
  * @link      http://status.net/
  */
 
-class RawPublicNoticeStream extends NoticeStream
+class RawPublicNoticeStream extends FullNoticeStream
 {
     function getNoticeIds($offset, $limit, $since_id, $max_id)
     {
@@ -81,22 +77,13 @@ 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 (!$this->allVerbs) {
-            $notice->whereAdd(sprintf('verb="%s" OR verb="%s"',
-                                      ActivityVerb::POST,
-                                      ActivityUtils::resolveUri(ActivityVerb::POST, true)));
-        }
+        self::filterVerbs($notice, $this->selectVerbs);
 
         $ids = array();