X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2Ftaggedprofilenoticestream.php;h=eec20cd8c660153f209ba1c518adc05d7da0fe95;hb=62a5e36a873cc4642bbc8120d0f42b26aa82e260;hp=291d3d6eb0de1d511f5ad3cb01b6bcdc27777bd8;hpb=d36f0707a488b6e2513193a0a2f72811435553ec;p=quix0rs-gnu-social.git diff --git a/lib/taggedprofilenoticestream.php b/lib/taggedprofilenoticestream.php index 291d3d6eb0..eec20cd8c6 100644 --- a/lib/taggedprofilenoticestream.php +++ b/lib/taggedprofilenoticestream.php @@ -1,14 +1,74 @@ . + * + * @category Stream + * @package StatusNet + * @author Evan Prodromou + * @copyright 2011 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 + * @link http://status.net/ + */ -class TaggedProfileNoticeStream extends CachingNoticeStream +if (!defined('STATUSNET')) { + // This check helps protect against security problems; + // your code file can't be executed directly from the web. + exit(1); +} + +/** + * Stream of notices with a given profile and tag + * + * @category Stream + * @package StatusNet + * @author Evan Prodromou + * @copyright 2011 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 + * @link http://status.net/ + */ + +class TaggedProfileNoticeStream extends ScopingNoticeStream { - function __construct($profile, $tag) + function __construct($profile, $tag, $userProfile=-1) { - parent::__construct(new RawTaggedProfileNoticeStream($profile, $tag), - 'profile:notice_ids_tagged:'.$profile->id.':'.Cache::keyize($tag)); + if (is_int($userProfile) && $userProfile == -1) { + $userProfile = Profile::current(); + } + parent::__construct(new CachingNoticeStream(new RawTaggedProfileNoticeStream($profile, $tag), + 'profile:notice_ids_tagged:'.$profile->id.':'.Cache::keyize($tag)), + $userProfile); } } +/** + * Raw stream of notices with a given profile and tag + * + * @category Stream + * @package StatusNet + * @author Evan Prodromou + * @copyright 2011 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 + * @link http://status.net/ + */ + class RawTaggedProfileNoticeStream extends NoticeStream { protected $profile;