From 75bdc37b619fa125e04e0d1dbafd32a54024a0a7 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 18 Sep 2011 14:06:27 -0400 Subject: [PATCH] Correct args for join event --- .../SubscriptionThrottlePlugin.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/plugins/SubscriptionThrottle/SubscriptionThrottlePlugin.php b/plugins/SubscriptionThrottle/SubscriptionThrottlePlugin.php index 829219af20..9e6fc9cab7 100644 --- a/plugins/SubscriptionThrottle/SubscriptionThrottlePlugin.php +++ b/plugins/SubscriptionThrottle/SubscriptionThrottlePlugin.php @@ -81,15 +81,15 @@ class SubscriptionThrottlePlugin extends Plugin /** * Filter group joins to see if they're coming too fast. * - * @param Group $group The group being joined - * @param User $user The user joining + * @param Group $group The group being joined + * @param Profile $profile The profile joining * * @return boolean hook value */ - function onStartJoinGroup($group, $user) + function onStartJoinGroup($group, $profile) { foreach ($this->groupLimits as $seconds => $limit) { - $mem = $this->_getNthMem($user, $limit); + $mem = $this->_getNthMem($profile, $limit); if (!empty($mem)) { $jointime = strtotime($mem->created); @@ -130,16 +130,16 @@ class SubscriptionThrottlePlugin extends Plugin /** * Get the Nth most recent group membership for this user * - * @param User $user The user to get memberships for - * @param integer $n How far to count back + * @param Profile $profile The user to get memberships for + * @param integer $n How far to count back * * @return Group_member a membership or null */ - private function _getNthMem($user, $n) + private function _getNthMem($profile, $n) { $mem = new Group_member(); - $mem->profile_id = $user->id; + $mem->profile_id = $profile->id; $mem->orderBy('created DESC'); $mem->limit($n - 1, 1);