. * * @category Plugin * @package StatusNet * @author Zach Copley * @copyright 2010 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ if (!defined('STATUSNET')) { exit(1); } class FacebookQueueHandler extends QueueHandler { function transport() { return 'facebook'; } function handle($notice) { common_debug( sprintf( 'ZZZZZ handle() - Looking at notice %d', $notice->id ), __FILE__ ); if ($this->_isLocal($notice)) { common_debug( sprintf( 'ZZZZZ handle() - notice %d is local; will try sending to Facebook.', $notice->id ), __FILE__ ); return Facebookclient::facebookBroadcastNotice($notice); } common_debug( sprintf( 'ZZZZZ handle() - notice %d was not a local notice, so we wont rebroadcast it.', $notice->id ), __FILE__ ); 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); } }