Merge branch 'master' of git@gitorious.org:statusnet/mainline into testing

This commit is contained in:
Brion Vibber 2010-03-23 12:13:32 -07:00
commit 7277b59734
5 changed files with 15 additions and 5 deletions

View File

@ -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(

View File

@ -63,7 +63,8 @@ class Conversation extends Memcached_DataObject
}
$orig = clone($conv);
$orig->uri = common_local_url('conversation', array('id' => $id));
$orig->uri = common_local_url('conversation', array('id' => $id),
null, null, false);
$result = $orig->update($conv);
if (empty($result)) {

View File

@ -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;

View File

@ -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.'));

View File

@ -1529,7 +1529,8 @@ function common_user_uri(&$user)
function common_notice_uri(&$notice)
{
return common_local_url('shownotice',
array('notice' => $notice->id));
array('notice' => $notice->id),
null, null, false);
}
// 36 alphanums - lookalikes (0, O, 1, I) = 32 chars = 5 bits