From a85bbd908821fb09de6a291a167ab19902cb2ed2 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 27 Dec 2010 20:49:08 -0800 Subject: [PATCH] Add a user parameter to atom pub api events --- EVENTS.txt | 2 ++ actions/apitimelineuser.php | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/EVENTS.txt b/EVENTS.txt index 65265cdf0f..521f568efe 100644 --- a/EVENTS.txt +++ b/EVENTS.txt @@ -969,9 +969,11 @@ EndRevokeRole: when a role has been revoked StartAtomPubNewActivity: When a new activity comes in through Atom Pub API - &$activity: received activity +- $user: user publishing the entry EndAtomPubNewActivity: When a new activity comes in through Atom Pub API - $activity: received activity +- $user: user publishing the entry - $notice: notice that was created StartXrdActionAliases: About to set aliases for the XRD object for a user diff --git a/actions/apitimelineuser.php b/actions/apitimelineuser.php index 42988a00f6..1573f74897 100644 --- a/actions/apitimelineuser.php +++ b/actions/apitimelineuser.php @@ -324,7 +324,7 @@ class ApiTimelineUserAction extends ApiBareAuthAction $activity = new Activity($dom->documentElement); - if (Event::handle('StartAtomPubNewActivity', array(&$activity))) { + if (Event::handle('StartAtomPubNewActivity', array(&$activity, $this->user))) { if ($activity->verb != ActivityVerb::POST) { // TRANS: Client error displayed when not using the POST verb. @@ -347,7 +347,7 @@ class ApiTimelineUserAction extends ApiBareAuthAction $saved = $this->postNote($activity); - Event::handle('EndAtomPubNewActivity', array($activity, $saved)); + Event::handle('EndAtomPubNewActivity', array($activity, $this->user, $saved)); } if (!empty($saved)) { -- 2.39.5