summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2010-05-06 00:20:10 -0700
committerZach Copley <zach@status.net>2010-05-06 21:48:11 +0000
commit22fde00defe79a153ed77ddf6a4e63dd7fef6743 (patch)
tree2d17dd355e6a931c600115c0f9e6d37a7b2b108e /actions
parentb547079b280b9fa2f8877aab7ad5cd3761f500b9 (diff)
Refactor and centralize notice source link calculation
Diffstat (limited to 'actions')
-rw-r--r--actions/twitapisearchatom.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/actions/twitapisearchatom.php b/actions/twitapisearchatom.php
index 24aa619bd..3eb54ccc3 100644
--- a/actions/twitapisearchatom.php
+++ b/actions/twitapisearchatom.php
@@ -342,10 +342,21 @@ class TwitapisearchatomAction extends ApiAction
'rel' => 'related',
'href' => $profile->avatarUrl()));
- // TODO: Here is where we'd put in a link to an atom feed for threads
+ // @todo: Here is where we'd put in a link to an atom feed for threads
+
+ $source = null;
+
+ $ns = $notice->getSource();
+ if ($ns) {
+ if (!empty($ns->name) && !empty($ns->url)) {
+ $source = '<a href="' . $ns->url . '">' . $ns->name . '</a>';
+ } else {
+ $source = $ns->code;
+ }
+ }
$this->element("twitter:source", null,
- htmlentities($this->sourceLink($notice->source)));
+ htmlentities($source));
$this->elementStart('author');