SalmonAction and extensions simplified

This commit is contained in:
Mikael Nordfeldth
2014-06-28 20:33:09 +02:00
parent 3f21d22a31
commit d0da552722
5 changed files with 46 additions and 78 deletions

View File

@@ -28,6 +28,9 @@ class SalmonAction extends Action
{
protected $needPost = true;
protected $oprofile = null; // Ostatus_profile of the actor
protected $actor = null; // Profile object of the actor
var $xml = null;
var $activity = null;
var $target = null;
@@ -63,6 +66,9 @@ class SalmonAction extends Action
$this->clientError(_m('Salmon signature verification failed.'));
}
$this->oprofile = $this->ensureProfile();
$this->actor = $this->oprofile->localProfile();
return true;
}
@@ -216,6 +222,7 @@ class SalmonAction extends Action
throw new Exception(_m('Received a salmon slap from unidentified actor.'));
}
// ensureActivityObjectProfile throws exception on failure
return Ostatus_profile::ensureActivityObjectProfile($actor);
}