summaryrefslogtreecommitdiff
path: root/actions/twitapisearchatom.php
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2010-05-06 00:20:10 -0700
committerZach Copley <zach@status.net>2010-05-18 15:15:27 -0700
commitc78f67aa7367acab5f9156ecf8963e2d5243e400 (patch)
treeab525d91b96ca159e6e5b41b8137731257f032d1 /actions/twitapisearchatom.php
parentd9fddff5395e77287c4de0796fd072b3073f1eb9 (diff)
Refactor and centralize notice source link calculation
Diffstat (limited to 'actions/twitapisearchatom.php')
-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');