]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
use -1 for invalid arg default in ScopingNoticeStream
authorEvan Prodromou <evan@status.net>
Mon, 11 Apr 2011 15:17:14 +0000 (11:17 -0400)
committerEvan Prodromou <evan@status.net>
Mon, 11 Apr 2011 15:17:14 +0000 (11:17 -0400)
lib/scopingnoticestream.php

index a7ecbcd56ba8c34f44251317e28a93309edce8a6..30b80f10e57569866d4b50518a0ec61078e1058b 100644 (file)
@@ -49,16 +49,15 @@ class ScopingNoticeStream extends FilteringNoticeStream
 {
     protected $profile;
 
-    function __construct($upstream, $profile = null)
+    function __construct($upstream, $profile = -1)
     {
         parent::__construct($upstream);
 
-        if (empty($profile)) {
-            $user = common_current_user();
-            if (!empty($user)) {
-                $profile = $user->getProfile();
-            }
+        // Invalid but not null
+        if (is_int($profile) && $profile == -1) {
+            $profile = Profile::current();
         }
+
         $this->profile = $profile;
     }
 
@@ -74,5 +73,4 @@ class ScopingNoticeStream extends FilteringNoticeStream
     {
         return $notice->inScope($this->profile);
     }
-    
 }