summaryrefslogtreecommitdiff
path: root/lib/api.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-02-03 12:32:48 -0500
committerEvan Prodromou <evan@status.net>2010-02-03 12:32:48 -0500
commit900cb8dd91b954d4e720b0c8afb2884419f43cd7 (patch)
treec2308c56f097d735273e965374240dfc20ded284 /lib/api.php
parentaa4848d62d9bcc8166f18f4a18e5a3d2a6a51537 (diff)
parentefa930ab000e1e022f0754d9f421e8859024142c (diff)
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing
Diffstat (limited to 'lib/api.php')
-rw-r--r--lib/api.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/api.php b/lib/api.php
index 10a2fae28..f81975216 100644
--- a/lib/api.php
+++ b/lib/api.php
@@ -1249,10 +1249,27 @@ class ApiAction extends Action
case 'api':
break;
default:
+
+ $name = null;
+ $url = null;
+
$ns = Notice_source::staticGet($source);
+
if ($ns) {
- $source_name = '<a href="' . $ns->url . '">' . $ns->name . '</a>';
+ $name = $ns->name;
+ $url = $ns->url;
+ } else {
+ $app = Oauth_application::staticGet('name', $source);
+ if ($app) {
+ $name = $app->name;
+ $url = $app->source_url;
+ }
+ }
+
+ if (!empty($name) && !empty($url)) {
+ $source_name = '<a href="' . $url . '">' . $name . '</a>';
}
+
break;
}
return $source_name;