Remote notice creators should not have notice is_local default to LOCAL_PUBLIC

This commit is contained in:
Mikael Nordfeldth 2015-10-14 00:10:01 +02:00
parent 005c108118
commit 236bf0b0f5

View File

@ -754,7 +754,7 @@ class Notice extends Managed_DataObject
$defaults = array( $defaults = array(
'groups' => array(), 'groups' => array(),
'is_local' => self::LOCAL_PUBLIC, 'is_local' => $actor->isLocal() ? self::LOCAL_PUBLIC : self::REMOTE,
'mentions' => array(), 'mentions' => array(),
'reply_to' => null, 'reply_to' => null,
'repeat_of' => null, 'repeat_of' => null,
@ -788,7 +788,8 @@ class Notice extends Managed_DataObject
// Sandboxed are non-false, but not 1, either // Sandboxed are non-false, but not 1, either
if (!$actor->hasRight(Right::PUBLICNOTICE) || if (!$actor->hasRight(Right::PUBLICNOTICE) ||
($source && $autosource && in_array($source, $autosource))) { ($source && $autosource && in_array($source, $autosource))) {
// FIXME: ...what about remote nonpublic? Hmmm. That is, if we sandbox remote profiles...
$stored->is_local = Notice::LOCAL_NONPUBLIC; $stored->is_local = Notice::LOCAL_NONPUBLIC;
} else { } else {
$stored->is_local = $is_local; $stored->is_local = $is_local;