Commit 5b91223c authored by Evan Prodromou's avatar Evan Prodromou

add a hook at point of enqueuing notices

parent 3c89d31b
......@@ -254,3 +254,10 @@ StartApiRss: after the rss <channel> element is started
StartApiAtom: after the <feed> element is started
- $action: action object being shown
StartEnqueueNotice: about to add a notice to the queues (good place to add a new transport)
- $notice: the notice being added
- &$transports: modifiable list of transports (as strings) to queue for
EndEnqueueNotice: after adding a notice to the queues
- $notice: the notice being added
- $transports: modifiable list of transports to use
......@@ -915,11 +915,16 @@ function common_enqueue_notice($notice)
}
}
$qm = QueueManager::get();
if (Event::handle('StartEnqueueNotice', array($notice, &$transports))) {
foreach ($transports as $transport)
{
$qm->enqueue($notice, $transport);
$qm = QueueManager::get();
foreach ($transports as $transport)
{
$qm->enqueue($notice, $transport);
}
Event::handle('EndEnqueueNotice', array($notice, $transports));
}
return true;
......@@ -1384,7 +1389,7 @@ function common_shorten_url($long_url)
}
$reflectionObj = new ReflectionClass($_shorteners[$svc]['callInfo'][0]);
$short_url_service = $reflectionObj->newInstanceArgs($_shorteners[$svc]['callInfo'][1]);
$short_url_service = $reflectionObj->newInstanceArgs($_shorteners[$svc]['callInfo'][1]);
$short_url = $short_url_service->shorten($long_url);
if(substr($short_url,0,7)=='http://'){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment