Merge branch '1.0.x' of gitorious.org:statusnet/mainline into 1.0.x

This commit is contained in:
Samantha Doherty 2011-08-26 12:52:18 -04:00
commit 2601b57505
5 changed files with 25 additions and 9 deletions

View File

@ -152,4 +152,18 @@ abstract class Managed_DataObject extends Memcached_DataObject
return $style; return $style;
} }
function links()
{
$links = array();
$table = call_user_func(array(get_class($this), 'schemaDef'));
foreach ($table['foreign keys'] as $keyname => $keydef) {
if (count($keydef) == 2 && is_string($keydef[0]) && is_array($keydef[1]) && count($keydef[1]) == 1) {
$links[$keydef[1][0]] = $keydef[0].':'.$keydef[1][1];
}
}
return $links;
}
} }

View File

@ -435,6 +435,7 @@ class Profile extends Managed_DataObject
$tags->tagged = $this->id; $tags->tagged = $this->id;
$lists->joinAdd($tags); $lists->joinAdd($tags);
#@fixme: postgres (round(date_part('epoch', my_date))) #@fixme: postgres (round(date_part('epoch', my_date)))
$lists->selectAdd('unix_timestamp(profile_tag.modified) as "cursor"'); $lists->selectAdd('unix_timestamp(profile_tag.modified) as "cursor"');
@ -507,7 +508,8 @@ class Profile extends Managed_DataObject
$lists = new Profile_list(); $lists = new Profile_list();
$subs = new Profile_tag_subscription(); $subs = new Profile_tag_subscription();
$lists->joinAdd($subs); $lists->joinAdd('id', 'profile_tag_subscription:profile_tag_id');
#@fixme: postgres (round(date_part('epoch', my_date))) #@fixme: postgres (round(date_part('epoch', my_date)))
$lists->selectAdd('unix_timestamp(profile_tag_subscription.created) as "cursor"'); $lists->selectAdd('unix_timestamp(profile_tag_subscription.created) as "cursor"');

View File

@ -220,10 +220,9 @@ class Profile_list extends Managed_DataObject
function getSubscribers($offset=0, $limit=null, $since=0, $upto=0) function getSubscribers($offset=0, $limit=null, $since=0, $upto=0)
{ {
$subs = new Profile(); $subs = new Profile();
$sub = new Profile_tag_subscription();
$sub->profile_tag_id = $this->id;
$subs->joinAdd($sub); $subs->joinAdd(array('id', 'profile_tag_subscription:profile_tag_id'));
$subs->selectAdd('unix_timestamp(profile_tag_subscription.' . $subs->selectAdd('unix_timestamp(profile_tag_subscription.' .
'created) as "cursor"'); 'created) as "cursor"');

View File

@ -310,7 +310,8 @@ $default =
'TagSub' => null, 'TagSub' => null,
'OpenID' => null, 'OpenID' => null,
'Directory' => null, 'Directory' => null,
'ExtendedProfile' => null), 'ExtendedProfile' => null,
'Activity' => null),
'locale_path' => false, // Set to a path to use *instead of* each plugin's own locale subdirectories 'locale_path' => false, // Set to a path to use *instead of* each plugin's own locale subdirectories
'server' => null, 'server' => null,
'sslserver' => null, 'sslserver' => null,

View File

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