Type-aware comparison is necessary for Notice is_local/scope

This commit is contained in:
Mikael Nordfeldth
2015-10-14 00:27:51 +02:00
parent b6aeff89c4
commit 79c40bc73b
8 changed files with 22 additions and 35 deletions

View File

@@ -40,22 +40,9 @@ class FacebookQueueHandler extends QueueHandler
function handle($notice)
{
if ($this->_isLocal($notice)) {
if ($notice->isLocal()) {
return Facebookclient::facebookBroadcastNotice($notice);
}
return true;
}
/**
* Determine whether the notice was locally created
*
* @param Notice $notice the notice
*
* @return boolean locality
*/
function _isLocal($notice)
{
return ($notice->is_local == Notice::LOCAL_PUBLIC ||
$notice->is_local == Notice::LOCAL_NONPUBLIC);
}
}