diff options
author | Craig Andrews <candrews@integralblue.com> | 2010-02-02 17:00:10 -0500 |
---|---|---|
committer | Craig Andrews <candrews@integralblue.com> | 2010-02-02 17:00:10 -0500 |
commit | 057ec1fceacbfec1f755a5bc6700a188aa70e33f (patch) | |
tree | 297839a71d9d3a7a0a7935d5dbcc9c4a3c6c99bb /lib/api.php | |
parent | d14651706cf728f116b7ae44c6a6e37b5eb918a4 (diff) | |
parent | f60f2c523f2e7018ea923898931287e7a99e8f44 (diff) |
Merge branch '0.9.x' into 1.0.x
Conflicts:
EVENTS.txt
lib/imqueuehandler.php
lib/jabber.php
lib/util.php
plugins/Xmpp/Sharing_XMPP.php
Diffstat (limited to 'lib/api.php')
-rw-r--r-- | lib/api.php | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/api.php b/lib/api.php index 825262b4c..7d94eaee4 100644 --- a/lib/api.php +++ b/lib/api.php @@ -299,7 +299,7 @@ class ApiAction extends Action } } - if ($include_user) { + if ($include_user && $profile) { # Don't get notice (recursive!) $twitter_user = $this->twitterUserArray($profile, false); $twitter_status['user'] = $twitter_user; @@ -1250,10 +1250,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; |