New event for Salmon including target
This commit is contained in:
parent
4777c927ad
commit
b54ea6767a
@ -47,6 +47,9 @@ class GroupsalmonAction extends SalmonAction
|
||||
$this->clientError(_m('No such group.'));
|
||||
}
|
||||
|
||||
|
||||
$this->target = $this->group;
|
||||
|
||||
$oprofile = Ostatus_profile::staticGet('group_id', $id);
|
||||
if ($oprofile) {
|
||||
// TRANS: Client error.
|
||||
|
@ -43,6 +43,8 @@ class UsersalmonAction extends SalmonAction
|
||||
$this->clientError(_m('No such user.'));
|
||||
}
|
||||
|
||||
$this->target = $this->user;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user