* @author James Walker <james@status.net>
*/
-if (!defined('STATUSNET')) {
- exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
class SalmonAction extends Action
{
var $activity = null;
var $target = null;
- function prepare($args)
+ protected function prepare(array $args=array())
{
StatusNet::setApi(true); // Send smaller error pages
* Check the posted activity type and break out to appropriate processing.
*/
- function handle($args)
+ protected function handle()
{
- StatusNet::setApi(true); // Send smaller error pages
+ parent::handle();
common_log(LOG_DEBUG, "Got a " . $this->activity->verb);
if (Event::handle('StartHandleSalmonTarget', array($this->activity, $this->target)) &&
* @param Profile $actor
* @return boolean success
*/
- public function notifyActivity($entry, $actor)
+ public function notifyActivity($entry, Profile $actor)
{
if ($this->salmonuri) {
$salmon = new Salmon();
return $salmon->post($this->salmonuri, $this->notifyPrepXml($entry), $actor);
}
+ common_debug(__CLASS__.' error: No salmonuri for Ostatus_profile uri: '.$this->uri);
return false;
}
* @param Profile $actor local user profile whose keys to sign with
* @return boolean success
*/
- public function post($endpoint_uri, $xml, $actor)
+ public function post($endpoint_uri, $xml, Profile $actor)
{
if (empty($endpoint_uri)) {
return false;