$notice->profile_id = $profile_id;
$autosource = common_config('public', 'autosource');
-
- // Sandboxed are non-false, but not 1, either
-
- if (!$profile->hasRight(Right::PUBLICNOTICE) ||
- ($source && $autosource && in_array($source, $autosource))) {
+ if ($source && $autosource && in_array($source, $autosource)) {
$notice->is_local = Notice::LOCAL_NONPUBLIC;
} else {
$notice->is_local = $is_local;
}
}
- $autosource = common_config('public', 'autosource');
+ // NOTE: Sandboxed users previously got all the notices _during_
+ // sandbox period set to to is_local=Notice::LOCAL_NONPUBLIC here.
+ // Since then we have started just filtering _when_ it gets shown
+ // instead of creating a mixed jumble of differently scoped notices.
- // Sandboxed are non-false, but not 1, either
- if (!$actor->hasRight(Right::PUBLICNOTICE) ||
- ($source && $autosource && in_array($source, $autosource))) {
- // FIXME: ...what about remote nonpublic? Hmmm. That is, if we sandbox remote profiles...
+ $autosource = common_config('public', 'autosource');
+ if ($source && $autosource && in_array($source, $autosource)) {
$stored->is_local = Notice::LOCAL_NONPUBLIC;
} else {
$stored->is_local = intval($is_local);
$this->upstream = $upstream;
}
+ /**
+ * @return boolean true if we allow it, false if we deny it
+ */
abstract protected function filter(Notice $notice);
function getNoticeIds($offset, $limit, $since_id, $max_id)
// If the notice author is sandboxed
if ($notice->getProfile()->isSandboxed()) {
- // and we're either not logged in OR we aren't some kind of privileged user that can see spam etc.
- if (!$this->scoped instanceof Profile || !$this->scoped->hasRight(Right::REVIEWSPAM)) {
+ if (!$this->scoped instanceof Profile) {
+ // Non-logged in users don't get to see posts by sandboxed users
+ return false;
+ } elseif (!$notice->getProfile()->sameAs($this->scoped) && !$this->scoped->hasRight(Right::REVIEWSPAM)) {
+ // And if we are logged in, deny if scoped user is neither the author nor has the right to review spam
return false;
}
}