summaryrefslogtreecommitdiff
path: root/classes/Notice.php
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2010-06-17 23:08:40 +0000
committerZach Copley <zach@status.net>2010-06-17 23:08:40 +0000
commit105c1a22d6513d9a5cb33d6134a6d60d423ee462 (patch)
treee42a23d621b9d358c5d6257a2ee5fc4ff0993e63 /classes/Notice.php
parenta6ce4eef0df225dd863baf45d5615cbe22dcdea6 (diff)
Include source client's related URL (if any) in source attribution for
Atom notice feeds
Diffstat (limited to 'classes/Notice.php')
-rw-r--r--classes/Notice.php24
1 files changed, 20 insertions, 4 deletions
diff --git a/classes/Notice.php b/classes/Notice.php
index 0838ca2a2..f8eda5777 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -1238,9 +1238,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();
@@ -1252,8 +1268,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)) {