diff options
author | Evan Prodromou <evan@status.net> | 2010-03-17 09:38:39 -0500 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-03-17 09:38:39 -0500 |
commit | 4761c07ad8d76f7c34d4db53d32d15e806ba1e88 (patch) | |
tree | eb3d78ccde1778037165c92b6ec36c7465b54345 /plugins/OStatus/lib | |
parent | f21f78364a9cbde2ca535a3983b384707ad097ae (diff) | |
parent | f62b8a80cf33ac8529d0736c51dc060a9d235369 (diff) |
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing
Diffstat (limited to 'plugins/OStatus/lib')
-rw-r--r-- | plugins/OStatus/lib/discovery.php | 11 | ||||
-rw-r--r-- | plugins/OStatus/lib/feeddiscovery.php | 4 | ||||
-rw-r--r-- | plugins/OStatus/lib/xrdaction.php | 6 |
3 files changed, 11 insertions, 10 deletions
diff --git a/plugins/OStatus/lib/discovery.php b/plugins/OStatus/lib/discovery.php index 6d245677a..44fad62fb 100644 --- a/plugins/OStatus/lib/discovery.php +++ b/plugins/OStatus/lib/discovery.php @@ -154,12 +154,13 @@ class Discovery_LRDD_Host_Meta implements Discovery_LRDD { public function discover($uri) { - if (!Discovery::isWebfinger($uri)) { - return false; + if (Discovery::isWebfinger($uri)) { + // We have a webfinger acct: - start with host-meta + list($name, $domain) = explode('@', $uri); + } else { + $domain = parse_url($uri, PHP_URL_HOST); } - - // We have a webfinger acct: - start with host-meta - list($name, $domain) = explode('@', $uri); + $url = 'http://'. $domain .'/.well-known/host-meta'; $xrd = Discovery::fetchXrd($url); diff --git a/plugins/OStatus/lib/feeddiscovery.php b/plugins/OStatus/lib/feeddiscovery.php index f9ea3e713..7de80b335 100644 --- a/plugins/OStatus/lib/feeddiscovery.php +++ b/plugins/OStatus/lib/feeddiscovery.php @@ -211,11 +211,11 @@ class FeedDiscovery $type = $node->attributes->getNamedItem('type'); $href = $node->attributes->getNamedItem('href'); if ($rel && $type && $href) { - $rel = trim($rel->value); + $rel = array_filter(explode(" ", $rel->value)); $type = trim($type->value); $href = trim($href->value); - if (trim($rel) == 'alternate' && array_key_exists($type, $feeds) && empty($feeds[$type])) { + if (in_array('alternate', $rel) && array_key_exists($type, $feeds) && empty($feeds[$type])) { // Save the first feed found of each type... $feeds[$type] = $this->resolveURI($href, $base); } diff --git a/plugins/OStatus/lib/xrdaction.php b/plugins/OStatus/lib/xrdaction.php index b3c1d8453..f1a56e0a8 100644 --- a/plugins/OStatus/lib/xrdaction.php +++ b/plugins/OStatus/lib/xrdaction.php @@ -46,10 +46,10 @@ class XrdAction extends Action if (empty($xrd->subject)) { $xrd->subject = Discovery::normalize($this->uri); } - $xrd->alias[] = common_profile_url($nick); + $xrd->alias[] = $this->user->uri; $xrd->links[] = array('rel' => Discovery::PROFILEPAGE, 'type' => 'text/html', - 'href' => common_profile_url($nick)); + 'href' => $this->user->uri); $xrd->links[] = array('rel' => Discovery::UPDATESFROM, 'href' => common_local_url('ApiTimelineUser', @@ -65,7 +65,7 @@ class XrdAction extends Action // XFN $xrd->links[] = array('rel' => 'http://gmpg.org/xfn/11', 'type' => 'text/html', - 'href' => common_profile_url($nick)); + 'href' => $this->user->uri); // FOAF $xrd->links[] = array('rel' => 'describedby', 'type' => 'application/rdf+xml', |