Fix errors thrown by code trying to broadcast profiles via OMB when the OMB plugin isn't installed

This commit is contained in:
Zach Copley 2011-08-02 01:15:30 -07:00
parent e530a0868d
commit b925eeecde
2 changed files with 18 additions and 4 deletions

View File

@ -1501,16 +1501,18 @@ function common_enqueue_notice($notice)
} }
/** /**
* Broadcast profile updates to remote subscribers. * Legacy function to broadcast profile updates to OMB remote subscribers.
*
* XXX: This probably needs killing, but there are several bits of code
* that broadcast profile changes that need to be dealt with. AFAIK
* this function is only used for OMB. -z
* *
* Since this may be slow with a lot of subscribers or bad remote sites, * Since this may be slow with a lot of subscribers or bad remote sites,
* this is run through the background queues if possible. * this is run through the background queues if possible.
*/ */
function common_broadcast_profile(Profile $profile) function common_broadcast_profile(Profile $profile)
{ {
$qm = QueueManager::get(); Event::handle('BroadcastProfile', array($profile));
$qm->enqueue($profile, "profile");
return true;
} }
function common_profile_url($nickname) function common_profile_url($nickname)

View File

@ -369,6 +369,18 @@ class OMBPlugin extends Plugin
return true; return true;
} }
/**
* Broadcast a profile over OMB
*
* @param Profile $profile to broadcast
* @return false
*/
function onBroadcastProfile($profile) {
$qm = QueueManager::get();
$qm->enqueue($profile, "profile");
return true;
}
/** /**
* Plugin version info * Plugin version info
* *