From 506c2d7491f7f229a1469ef176fee6c21d61a6c6 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Fri, 12 Feb 2010 12:22:12 -0800 Subject: Initial upgraded Atom output for group timelines --- classes/User_group.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'classes') 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 -- cgit v1.2.3-54-g00ecf From d6f1df8b76259acfc0d0566e8bf3610172b27884 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 12 Feb 2010 15:30:23 -0800 Subject: fix for Atom notice output: correct check against conversation & current id --- classes/Notice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/Notice.php b/classes/Notice.php index 924931e42..73b22d58a 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -1016,7 +1016,7 @@ class Notice extends Memcached_DataObject } if (!empty($this->conversation) - && $this->conversation != $this->notice->id) { + && $this->conversation != $this->id) { $xs->element( 'link', array( 'rel' => 'ostatus:conversation', -- cgit v1.2.3-54-g00ecf