diff options
author | Zach Copley <zach@status.net> | 2010-05-05 22:35:16 -0700 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2010-05-18 15:15:14 -0700 |
commit | d9fddff5395e77287c4de0796fd072b3073f1eb9 (patch) | |
tree | ee526d4abadbf9f82e82b07ee9d659f1cfcfbc89 /classes | |
parent | 14a76926a225dec3d29aeffa13ab7ece74f708e5 (diff) |
Add xmlns:statusnet and statusnet:notice_info element to Atom entries for notices
Diffstat (limited to 'classes')
-rw-r--r-- | classes/Notice.php | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/classes/Notice.php b/classes/Notice.php index 0b1b2e402..9a9172cba 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -1171,7 +1171,7 @@ class Notice extends Memcached_DataObject return $groups; } - function asAtomEntry($namespace=false, $source=false, $author=true) + function asAtomEntry($namespace=false, $source=false, $author=true, $cur=null) { $profile = $this->getProfile(); @@ -1184,7 +1184,8 @@ class Notice extends Memcached_DataObject 'xmlns:activity' => 'http://activitystrea.ms/spec/1.0/', 'xmlns:media' => 'http://purl.org/syndication/atommedia', 'xmlns:poco' => 'http://portablecontacts.net/spec/1.0', - 'xmlns:ostatus' => 'http://ostatus.org/schema/1.0'); + 'xmlns:ostatus' => 'http://ostatus.org/schema/1.0', + 'xmlns:statusnet' => 'http://status.net/ont/'); } else { $attrs = array(); } @@ -1210,6 +1211,18 @@ class Notice extends Memcached_DataObject $xs->element('icon', null, $profile->avatarUrl(AVATAR_PROFILE_SIZE)); $xs->element('updated', null, common_date_w3dtf($this->created)); + + $noticeInfoAttr = array( + 'local_id' => $this->id, // local notice ID (useful to clients for ordering) + 'source' => $this->source // the client name (source attribution) + // @todo source source_link + ); + + if (!empty($cur)) { + $noticeInfoAttr['favorited'] = ($cur->hasFave($this)) ? 'true' : 'false'; + } + + $xs->element('statusnet:notice_info', $noticeInfoAttr, null); } if ($source) { |