We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit bae9eaca authored by Evan Prodromou's avatar Evan Prodromou

use -1 for invalid arg default in ScopingNoticeStream

parent f9a91a28
...@@ -49,16 +49,15 @@ class ScopingNoticeStream extends FilteringNoticeStream ...@@ -49,16 +49,15 @@ class ScopingNoticeStream extends FilteringNoticeStream
{ {
protected $profile; protected $profile;
function __construct($upstream, $profile = null) function __construct($upstream, $profile = -1)
{ {
parent::__construct($upstream); parent::__construct($upstream);
if (empty($profile)) { // Invalid but not null
$user = common_current_user(); if (is_int($profile) && $profile == -1) {
if (!empty($user)) { $profile = Profile::current();
$profile = $user->getProfile();
}
} }
$this->profile = $profile; $this->profile = $profile;
} }
...@@ -74,5 +73,4 @@ class ScopingNoticeStream extends FilteringNoticeStream ...@@ -74,5 +73,4 @@ class ScopingNoticeStream extends FilteringNoticeStream
{ {
return $notice->inScope($this->profile); return $notice->inScope($this->profile);
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment