Merge commit 'refs/merge-requests/158' of git://gitorious.org/statusnet/mainline into merge-requests/158

Conflicts:
	classes/Profile_list.php
	lib/peopletagnoticestream.php
This commit is contained in:
Evan Prodromou 2011-09-26 17:11:49 -04:00
commit 8c710ad2c1
3 changed files with 17 additions and 15 deletions

View File

@ -221,7 +221,10 @@ class Profile_list extends Managed_DataObject
{
$subs = new Profile();
$subs->joinAdd(array('id', 'profile_tag_subscription:profile_tag_id'));
$subs->joinAdd(
array('id', 'profile_tag_subscription:profile_id')
);
$subs->whereAdd('profile_tag_subscription.profile_tag_id = ' . $this->id);
$subs->selectAdd('unix_timestamp(profile_tag_subscription.' .
'created) as "cursor"');

View File

@ -79,20 +79,17 @@ class Profile_tag extends Managed_DataObject
return $tags;
}
$profile_tag = new Profile_tag();
$profile_list->tagger = $tagger;
$profile_tag->tagged = $tagged;
$qry = 'select profile_list.* from profile_list left join '.
'profile_tag on (profile_list.tag = profile_tag.tag and '.
'profile_list.tagger = profile_tag.tagger) where '.
'profile_tag.tagger = %d and profile_tag.tagged = %d ';
$qry = sprintf($qry, $tagger, $tagged);
$profile_list->selectAdd();
if (!$include_priv) {
$qry .= 'profile_list.private = 0';
}
// only fetch id, tag, mainpage and
// private hoping this will be faster
$profile_list->selectAdd('profile_list.id, ' .
'profile_list.tag, ' .
'profile_list.mainpage, ' .
'profile_list.private');
$profile_list->joinAdd($profile_tag);
$profile_list->find();
$profile_list->query($qry);
Profile_list::setCache($key, $profile_list);

View File

@ -96,10 +96,12 @@ class RawPeopletagNoticeStream extends NoticeStream
$notice->selectAdd();
$notice->selectAdd('notice.id');
$ptag = new Profile_tag();
$ptag->tag = $this->profile_list->tag;
$ptag->tagger = $this->profile_list->tagger;
$notice->joinAdd(array('profile_id', 'profile_tag:tagged'));
$notice->whereAdd('profile_tag.tagger = ' . $this->profile_list->tagger);
$notice->whereAdd(sprintf('profile_tag.tag = "%s"', $this->profile_list->tag));
$notice->whereAdd(sprintf('profile_tag.tagger = %d', $this->profile_list->tagger));
if ($since_id != 0) {
$notice->whereAdd('notice.id > ' . $since_id);