function handle_notice($notice) { if ($this->is_remote($notice)) { $this->log(LOG_DEBUG, 'Ignoring remote notice ' . $notice->id); return true; } else { return omb_broadcast_remote_subscribers($notice); } }
function enqueue($object, $queue) { $notice = $object; switch ($queue) { case 'omb': if ($this->_isLocal($notice)) { require_once INSTALLDIR . '/lib/omb.php'; omb_broadcast_remote_subscribers($notice); } break; case 'public': if ($this->_isLocal($notice)) { require_once INSTALLDIR . '/lib/jabber.php'; jabber_public_notice($notice); } break; case 'twitter': if ($this->_isLocal($notice)) { broadcast_twitter($notice); } break; case 'facebook': if ($this->_isLocal($notice)) { require_once INSTALLDIR . '/lib/facebookutil.php'; return facebookBroadcastNotice($notice); } break; case 'ping': if ($this->_isLocal($notice)) { require_once INSTALLDIR . '/lib/ping.php'; return ping_broadcast_notice($notice); } case 'sms': require_once INSTALLDIR . '/lib/mail.php'; mail_broadcast_notice_sms($notice); break; case 'jabber': require_once INSTALLDIR . '/lib/jabber.php'; jabber_broadcast_notice($notice); break; default: throw ServerException("UnQueueManager: Unknown queue: {$type}"); } }
function common_real_broadcast($notice, $remote = false) { $success = true; if (!$remote) { // Make sure we have the OMB stuff require_once INSTALLDIR . '/lib/omb.php'; $success = omb_broadcast_remote_subscribers($notice); if (!$success) { common_log(LOG_ERR, 'Error in OMB broadcast for notice ' . $notice->id); } } if ($success) { require_once INSTALLDIR . '/lib/jabber.php'; $success = jabber_broadcast_notice($notice); if (!$success) { common_log(LOG_ERR, 'Error in jabber broadcast for notice ' . $notice->id); } } if ($success) { require_once INSTALLDIR . '/lib/mail.php'; $success = mail_broadcast_notice_sms($notice); if (!$success) { common_log(LOG_ERR, 'Error in sms broadcast for notice ' . $notice->id); } } if ($success) { $success = jabber_public_notice($notice); if (!$success) { common_log(LOG_ERR, 'Error in public broadcast for notice ' . $notice->id); } } if ($success) { $success = broadcast_twitter($notice); if (!$success) { common_log(LOG_ERR, 'Error in Twitter broadcast for notice ' . $notice->id); } } // XXX: Do a real-time FB broadcast here? // XXX: broadcast notices to other IM return $success; }