return is_null($other) ? false : $other->isSubscribed($this);
}
- function requiresSubscriptionApproval(Profile $other=null)
+ function requiresSubscriptionApproval(Profile $other=null): bool
{
if (!$this->isLocal()) {
// We don't know for remote users, and we'll always be able to send
// If the local user either has a private stream (implies the following)
// or user has a moderation policy for new subscriptions, return true.
- return $this->getUser()->private_stream || $this->getUser()->subscribe_policy === User::SUBSCRIBE_POLICY_MODERATE;
+ return $this->isPrivateStream() || $this->getUser()->subscribe_policy === User::SUBSCRIBE_POLICY_MODERATE;
}
/**
return $this->getUser()->shortenLinks($text, $always);
}
- public function isPrivateStream()
+ public function isPrivateStream(): bool
{
// We only know of public remote users as of yet...
if (!$this->isLocal()) {
return false;
}
- return $this->getUser()->private_stream ? true : false;
+ $private_stream = $this->getUser()->private_stream;
+ return !is_null($private_stream) && $private_stream;
}
public function delPref($namespace, $topic) {