diff options
author | Brion Vibber <brion@pobox.com> | 2010-06-26 10:17:36 -0400 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-06-26 10:17:36 -0400 |
commit | 696e4ba393c658d5b2e1fe46e1389bd7b2cfdb34 (patch) | |
tree | 45c4f1512599175afea67f8a68e1b3ad66cace97 /classes/Notice.php | |
parent | 72e486a3226c9101f33bd86f953dbb9650c19fd1 (diff) | |
parent | d9e56e15cc3174093fc994e524d1d9cf402ae8a3 (diff) |
Merge branch 'testing' of gitorious.org:statusnet/mainline into 0.9.x
Conflicts:
plugins/OpenID/openidserver.php (cleaned up mismatched comment)
Diffstat (limited to 'classes/Notice.php')
-rw-r--r-- | classes/Notice.php | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/classes/Notice.php b/classes/Notice.php index fd8ad5493..482bc550b 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -1192,7 +1192,7 @@ class Notice extends Memcached_DataObject 'xmlns:media' => 'http://purl.org/syndication/atommedia', 'xmlns:poco' => 'http://portablecontacts.net/spec/1.0', 'xmlns:ostatus' => 'http://ostatus.org/schema/1.0', - 'xmlns:statusnet' => 'http://status.net/ont/'); + 'xmlns:statusnet' => 'http://status.net/schema/api/1/'); } else { $attrs = array(); } @@ -1227,7 +1227,7 @@ class Notice extends Memcached_DataObject $xs->element('title', null, common_xml_safe_str($this->content)); if ($author) { - $xs->raw($profile->asAtomAuthor()); + $xs->raw($profile->asAtomAuthor($cur)); $xs->raw($profile->asActivityActor()); } @@ -1240,9 +1240,25 @@ class Notice extends Memcached_DataObject $xs->element('published', null, common_date_w3dtf($this->created)); $xs->element('updated', null, common_date_w3dtf($this->created)); + $source = null; + + $ns = $this->getSource(); + + if ($ns) { + if (!empty($ns->name) && !empty($ns->url)) { + $source = '<a href="' + . htmlspecialchars($ns->url) + . '" rel="nofollow">' + . htmlspecialchars($ns->name) + . '</a>'; + } else { + $source = $ns->code; + } + } + $noticeInfoAttr = array( - 'local_id' => $this->id, // local notice ID (useful to clients for ordering) - 'source' => $this->source, // the client name (source attribution) + 'local_id' => $this->id, // local notice ID (useful to clients for ordering) + 'source' => $source, // the client name (source attribution) ); $ns = $this->getSource(); @@ -1254,8 +1270,8 @@ class Notice extends Memcached_DataObject if (!empty($cur)) { $noticeInfoAttr['favorite'] = ($cur->hasFave($this)) ? "true" : "false"; - $profile = $cur->getProfile(); - $noticeInfoAttr['repeated'] = ($profile->hasRepeated($this->id)) ? "true" : "false"; + $profile = $cur->getProfile(); + $noticeInfoAttr['repeated'] = ($profile->hasRepeated($this->id)) ? "true" : "false"; } if (!empty($this->repeat_of)) { |