X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FFacebook%2Ffacebookqueuehandler.php;h=524af7bc45fc39e99b8f8f29c20e4db43f9eafeb;hb=e5541d09d0776e69cc276a3b3e93abcc42b15e55;hp=e4ae7d4ee75769f579e0f078655f99cea2d042da;hpb=5f5413624d166a9b2116d266c7698dd6dcd2d8c4;p=quix0rs-gnu-social.git diff --git a/plugins/Facebook/facebookqueuehandler.php b/plugins/Facebook/facebookqueuehandler.php old mode 100755 new mode 100644 index e4ae7d4ee7..524af7bc45 --- a/plugins/Facebook/facebookqueuehandler.php +++ b/plugins/Facebook/facebookqueuehandler.php @@ -1,4 +1,3 @@ -#!/usr/bin/env php . */ -define('INSTALLDIR', realpath(dirname(__FILE__) . '/../..')); +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } -$shortoptions = 'i::'; -$longoptions = array('id::'); - -$helptext = <<log(LOG_INFO, "INITIALIZE"); + if ($this->_isLocal($notice)) { + return facebookBroadcastNotice($notice); + } return true; } - function handle_notice($notice) - { - return facebookBroadcastNotice($notice); - } - - function finish() + /** + * 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); } - -} - -if (have_option('i')) { - $id = get_option_value('i'); -} else if (have_option('--id')) { - $id = get_option_value('--id'); -} else if (count($args) > 0) { - $id = $args[0]; -} else { - $id = null; } - -$handler = new FacebookQueueHandler($id); - -$handler->runOnce();