summaryrefslogtreecommitdiff
path: root/classes/User_group.php
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2010-02-12 12:22:12 -0800
committerZach Copley <zach@status.net>2010-02-12 12:24:29 -0800
commit506c2d7491f7f229a1469ef176fee6c21d61a6c6 (patch)
tree5cab63ead0160c1a97c7e163b8adc66005a5156b /classes/User_group.php
parentfd3c9334bfcfe627446feb86ac3054b24ed05449 (diff)
Initial upgraded Atom output for group timelines
Diffstat (limited to 'classes/User_group.php')
-rw-r--r--classes/User_group.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/classes/User_group.php b/classes/User_group.php
index 1fbb50a6e..379e6b721 100644
--- a/classes/User_group.php
+++ b/classes/User_group.php
@@ -355,6 +355,39 @@ class User_group extends Memcached_DataObject
return $xs->getString();
}
+ function asAtomAuthor()
+ {
+ $xs = new XMLStringer(true);
+
+ $xs->elementStart('author');
+ $xs->element('name', null, $this->nickname);
+ $xs->element('uri', null, $this->permalink());
+ $xs->elementEnd('author');
+
+ return $xs->getString();
+ }
+
+ function asActivitySubject()
+ {
+ $xs = new XMLStringer(true);
+
+ $xs->elementStart('activity:subject');
+ $xs->element('activity:object', null, 'http://activitystrea.ms/schema/1.0/group');
+ $xs->element('id', null, $this->permalink());
+ $xs->element('title', null, $this->getBestName());
+ $xs->element(
+ 'link', array(
+ 'rel' => 'avatar',
+ 'href' => empty($this->homepage_logo)
+ ? User_group::defaultLogo(AVATAR_PROFILE_SIZE)
+ : $this->homepage_logo
+ )
+ );
+ $xs->elementEnd('activity:subject');
+
+ return $xs->getString();
+ }
+
static function register($fields) {
// MAGICALLY put fields into current scope