diff options
author | Brion Vibber <brion@pobox.com> | 2010-02-12 15:32:12 -0800 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-02-12 15:32:12 -0800 |
commit | f8a459a88adbdfc07b3fbf40c73dacc5b39ddbd9 (patch) | |
tree | 17aca874063515cffca802a0d411cc4ba98d2aae /classes | |
parent | 122c8677b7004bae4cfe7e2bd49fc1bc3187c72c (diff) | |
parent | d6f1df8b76259acfc0d0566e8bf3610172b27884 (diff) |
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'classes')
-rw-r--r-- | classes/Notice.php | 2 | ||||
-rw-r--r-- | classes/User_group.php | 33 |
2 files changed, 34 insertions, 1 deletions
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', 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 |