From b925eeecdec7bfe120ed3613f40046a88bb24488 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Tue, 2 Aug 2011 01:15:30 -0700 Subject: [PATCH] Fix errors thrown by code trying to broadcast profiles via OMB when the OMB plugin isn't installed --- lib/util.php | 10 ++++++---- plugins/OMB/OMBPlugin.php | 12 ++++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/lib/util.php b/lib/util.php index d358338519..ffa92fc69f 100644 --- a/lib/util.php +++ b/lib/util.php @@ -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, * this is run through the background queues if possible. */ function common_broadcast_profile(Profile $profile) { - $qm = QueueManager::get(); - $qm->enqueue($profile, "profile"); - return true; + Event::handle('BroadcastProfile', array($profile)); } function common_profile_url($nickname) diff --git a/plugins/OMB/OMBPlugin.php b/plugins/OMB/OMBPlugin.php index f5fed60079..38494c8134 100644 --- a/plugins/OMB/OMBPlugin.php +++ b/plugins/OMB/OMBPlugin.php @@ -369,6 +369,18 @@ class OMBPlugin extends Plugin 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 *