* StatusNet - the distributed open-source microblogging tool
* Copyright (C) 2011, StatusNet, Inc.
*
- * Stream of notices for a people tag
+ * Stream of notices for a list
*
* PHP version 5
*
* @link http://status.net/
*/
-if (!defined('STATUSNET')) {
- // This check helps protect against security problems;
- // your code file can't be executed directly from the web.
- exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
/**
- * Stream of notices for a people tag
+ * Stream of notices for a list
*
* @category Stream
* @package StatusNet
*/
class PeopletagNoticeStream extends ScopingNoticeStream
{
- function __construct($plist, $profile = -1)
+ function __construct($plist, Profile $scoped=null)
{
- if (is_int($profile) && $profile == -1) {
- $profile = Profile::current();
- }
parent::__construct(new CachingNoticeStream(new RawPeopletagNoticeStream($plist),
'profile_list:notice_ids:' . $plist->id),
- $profile);
+ $scoped);
}
}
/**
- * Stream of notices for a people tag
+ * Stream of notices for a list
*
* @category Stream
* @package StatusNet
$ptag = new Profile_tag();
$ptag->tag = $this->profile_list->tag;
$ptag->tagger = $this->profile_list->tagger;
- $notice->joinAdd($ptag);
+ $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));
if ($since_id != 0) {
$notice->whereAdd('notice.id > ' . $since_id);