/**
  * Only return notices where the profile is in scope
  *
  * @param Notice $notice The notice to check
  *
  * @return boolean whether to include the notice
  */
 function filter($notice)
 {
     return $notice->inScope($this->profile);
 }
Exemplo n.º 2
0
 /**
  * Put saved notices into the queue for OMB distribution
  *
  * @param Notice $notice     the notice to broadcast
  * @param array  $transports queuehandler's list of transports
  * @return boolean true if queing was successful
  */
 function onStartEnqueueNotice($notice, &$transports)
 {
     if ($notice->isLocal()) {
         if ($notice->inScope(null)) {
             array_unshift($transports, 'omb');
             common_log(LOG_INFO, "Notice {$notice->id} queued for OMB processing");
         } else {
             // Note: We don't do privacy-controlled OMB updates.
             common_log(LOG_NOTICE, "Not queueing notice {$notice->id} for OMB because of " . "privacy; scope = {$notice->scope}", __FILE__);
         }
     } else {
         common_log(LOG_NOTICE, "Not queueing notice {$notice->id} for OMB because it's not " . "local.", __FILE__);
     }
     return true;
 }
Exemplo n.º 3
0
 /**
  * Add a Twitter queue item for each notice
  *
  * @param Notice $notice      the notice
  * @param array  &$transports the list of transports (queues)
  *
  * @return boolean hook return
  */
 function onStartEnqueueNotice($notice, &$transports)
 {
     if (self::hasKeys() && $notice->isLocal() && $notice->inScope(null)) {
         // Avoid a possible loop
         if ($notice->source != 'twitter') {
             array_push($transports, 'twitter');
         }
     }
     return true;
 }
Exemplo n.º 4
0
 /**
  * Add a Facebook queue item for each notice
  *
  * @param Notice $notice      the notice
  * @param array  &$transports the list of transports (queues)
  *
  * @return boolean hook return
  */
 function onStartEnqueueNotice($notice, &$transports)
 {
     if (self::hasApplication() && $notice->isLocal() && $notice->inScope(null)) {
         array_push($transports, 'facebook');
     }
     return true;
 }