X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fatomgroupnoticefeed.php;h=817191b64aecee4cfffd40392fa778340688e89b;hb=c11bc8a9ba4a1c5c751052b46983bdc773112a5e;hp=c7c36af82571faf995447e5e5c3bc2ac8fa57a2a;hpb=7f3b3620af2af88ced37da1d9f8913cfd1a31b90;p=quix0rs-gnu-social.git diff --git a/lib/atomgroupnoticefeed.php b/lib/atomgroupnoticefeed.php index c7c36af825..817191b64a 100644 --- a/lib/atomgroupnoticefeed.php +++ b/lib/atomgroupnoticefeed.php @@ -85,8 +85,22 @@ class AtomGroupNoticeFeed extends AtomNoticeFeed $this->setId($self); $this->setSelfLink($self); - $this->addAuthorRaw($group->asAtomAuthor()); - $this->setActivitySubject($group->asActivitySubject()); + // For groups, we generate an author _AND_ an + // Versions of StatusNet under 0.9.7 treat as a person + // XXX: remove this workaround in future versions + + $ao = ActivityObject::fromGroup($group); + + $this->addAuthorRaw($ao->asString('author')); + + $depMsg = 'Deprecation warning: activity:subject is present ' + . 'only for backward compatibility. It will be ' + . 'removed in the next version of StatusNet.'; + + $this->addAuthorRaw( + "\n" + . $ao->asString('activity:subject') + ); $this->addLink($group->homeUrl()); } @@ -96,4 +110,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); + } }