diff options
author | Brion Vibber <brion@pobox.com> | 2010-03-23 11:06:37 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-03-23 11:06:37 -0700 |
commit | 533a3bf6a3180237cfffb8baf29ea3a3f7ec34f8 (patch) | |
tree | ef0c2815862253cdb1e98052301d7d09f1b05aff | |
parent | 2d79455a1fb7627a23a6ca77fbab060193f6c43a (diff) |
Consistently send Profiles into Fave::addNew()
-rw-r--r-- | actions/apifavoritecreate.php | 2 | ||||
-rw-r--r-- | classes/Fave.php | 10 | ||||
-rw-r--r-- | lib/command.php | 2 |
3 files changed, 11 insertions, 3 deletions
diff --git a/actions/apifavoritecreate.php b/actions/apifavoritecreate.php index 3618f9401..00b6349b0 100644 --- a/actions/apifavoritecreate.php +++ b/actions/apifavoritecreate.php @@ -123,7 +123,7 @@ class ApiFavoriteCreateAction extends ApiAuthAction return; } - $fave = Fave::addNew($this->user, $this->notice); + $fave = Fave::addNew($this->user->getProfile(), $this->notice); if (empty($fave)) { $this->clientError( diff --git a/classes/Fave.php b/classes/Fave.php index a04f15e9c..7ca9ade7f 100644 --- a/classes/Fave.php +++ b/classes/Fave.php @@ -21,7 +21,15 @@ class Fave extends Memcached_DataObject /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE - static function addNew($profile, $notice) { + /** + * Save a favorite record. + * @fixme post-author notification should be moved here + * + * @param Profile $profile the local or remote user who likes + * @param Notice $notice the notice that is liked + * @return mixed false on failure, or Fave record on success + */ + static function addNew(Profile $profile, Notice $notice) { $fave = null; diff --git a/lib/command.php b/lib/command.php index f7421269d..216f9e649 100644 --- a/lib/command.php +++ b/lib/command.php @@ -273,7 +273,7 @@ class FavCommand extends Command function handle($channel) { $notice = $this->getNotice($this->other); - $fave = Fave::addNew($this->user, $notice); + $fave = Fave::addNew($this->user->getProfile(), $notice); if (!$fave) { $channel->error($this->user, _('Could not create favorite.')); |