New event for Salmon including target

This commit is contained in:
Evan Prodromou
2010-12-27 10:51:59 -08:00
parent 4777c927ad
commit b54ea6767a
3 changed files with 9 additions and 1 deletions

View File

@@ -30,6 +30,7 @@ class SalmonAction extends Action
{
var $xml = null;
var $activity = null;
var $target = null;
function prepare($args)
{
@@ -82,7 +83,8 @@ class SalmonAction extends Action
StatusNet::setApi(true); // Send smaller error pages
common_log(LOG_DEBUG, "Got a " . $this->activity->verb);
if (Event::handle('StartHandleSalmon', array($this->activity))) {
if (Event::handle('StartHandleSalmonTarget', array($this->activity, $this->target)) &&
Event::handle('StartHandleSalmon', array($this->activity))) {
switch ($this->activity->verb)
{
case ActivityVerb::POST:
@@ -118,6 +120,7 @@ class SalmonAction extends Action
throw new ClientException(_m("Unrecognized activity type."));
}
Event::handle('EndHandleSalmon', array($this->activity));
Event::handle('EndHandleSalmonTarget', array($this->activity, $this->target));
}
}