]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/groupnoticestream.php
Added type-hints for StartInitializeRouter hooks.
[quix0rs-gnu-social.git] / lib / groupnoticestream.php
index 849dfeaaf5b9f09c43d5cafe2a16d49b2ebe9005..723f064cb3523dab13b8de075fbd66b0e140ff1a 100644 (file)
@@ -47,6 +47,7 @@ if (!defined('STATUSNET')) {
 class GroupNoticeStream extends ScopingNoticeStream
 {
     var $group;
+    var $userProfile;
 
     function __construct($group, $profile = -1)
     {
@@ -54,6 +55,7 @@ class GroupNoticeStream extends ScopingNoticeStream
             $profile = Profile::current();
         }
         $this->group = $group;
+        $this->userProfile = $profile;
 
         parent::__construct(new CachingNoticeStream(new RawGroupNoticeStream($group),
                                                     'user_group:notice_ids:' . $group->id),
@@ -72,7 +74,7 @@ class GroupNoticeStream extends ScopingNoticeStream
     function getNotices($offset, $limit, $sinceId = null, $maxId = null)
     {
         if ($this->impossibleStream()) {
-            return array();
+            return new ArrayWrapper(array());
         } else {
             return parent::getNotices($offset, $limit, $sinceId, $maxId);
         }
@@ -81,7 +83,7 @@ class GroupNoticeStream extends ScopingNoticeStream
     function impossibleStream() 
     {
         if ($this->group->force_scope &&
-            (empty($this->profile) || !$this->profile->isMember($group))) {
+            (empty($this->userProfile) || !$this->userProfile->isMember($this->group))) {
             return true;
         }