X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fatomgroupnoticefeed.php;h=39a1fd456efa02a3a89f553d4469f8ddbbf705a2;hb=0d99a01d7412be761a7888132573c2bc40848456;hp=b4810d04a082630cea2ce2b6b94d68b7944b5693;hpb=9b788471d4d5141bf4991367f1f46f2a4e35da36;p=quix0rs-gnu-social.git diff --git a/lib/atomgroupnoticefeed.php b/lib/atomgroupnoticefeed.php index b4810d04a0..39a1fd456e 100644 --- a/lib/atomgroupnoticefeed.php +++ b/lib/atomgroupnoticefeed.php @@ -50,12 +50,13 @@ class AtomGroupNoticeFeed extends AtomNoticeFeed * Constructor * * @param Group $group the group for the feed + * @param User $cur the current authenticated user, if any * @param boolean $indent flag to turn indenting on or off * * @return void */ - function __construct($group, $indent = true) { - parent::__construct($indent); + function __construct($group, $cur = null, $indent = true) { + parent::__construct($cur, $indent); $this->group = $group; // TRANS: Title in atom group notice feed. %s is a group name. @@ -95,4 +96,23 @@ class AtomGroupNoticeFeed extends AtomNoticeFeed return $this->group; } + function initFeed() + { + parent::initFeed(); + + $attrs = array(); + + if (!empty($this->cur)) { + $attrs['member'] = $this->cur->isMember($this->group) + ? 'true' : 'false'; + $attrs['blocked'] = Group_block::isBlocked( + $this->group, + $this->cur->getProfile() + ) ? 'true' : 'false'; + } + + $attrs['member_count'] = $this->group->getMemberCount(); + + $this->element('statusnet:group_info', $attrs, null); + } }