summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-03-03 18:28:39 -0800
committerBrion Vibber <brion@pobox.com>2010-03-03 18:28:39 -0800
commit14065ca350cae576461f1a2db33694e38cebf751 (patch)
tree285bbaa67fc999746c23b0db6dd60eadb51c3bdc
parenta4d9171306a06983094fdc90dbf040335c4f803f (diff)
OStatus: code cleanup on webfinger fallback path
-rw-r--r--plugins/OStatus/classes/Ostatus_profile.php14
1 files changed, 6 insertions, 8 deletions
diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php
index b3b4336b5..fcca1a252 100644
--- a/plugins/OStatus/classes/Ostatus_profile.php
+++ b/plugins/OStatus/classes/Ostatus_profile.php
@@ -1306,20 +1306,23 @@ class Ostatus_profile extends Memcached_DataObject
$result = $disco->lookup($addr);
} catch (Exception $e) {
// Save negative cache entry so we don't waste time looking it up again.
+ // @fixme distinguish temporary failures?
self::cacheSet(sprintf('ostatus_profile:webfinger:%s', $addr), null);
throw new Exception('Not a valid webfinger address.');
}
+ $hints = array('webfinger' => $addr);
+
foreach ($result->links as $link) {
switch ($link['rel']) {
case Discovery::PROFILEPAGE:
- $profileUrl = $link['href'];
+ $hints['profileurl'] = $profileUrl = $link['href'];
break;
case Salmon::NS_REPLIES:
- $salmonEndpoint = $link['href'];
+ $hints['salmon'] = $salmonEndpoint = $link['href'];
break;
case Discovery::UPDATESFROM:
- $feedUrl = $link['href'];
+ $hints['feedurl'] = $feedUrl = $link['href'];
break;
case Discovery::HCARD:
$hcardUrl = $link['href'];
@@ -1330,11 +1333,6 @@ class Ostatus_profile extends Memcached_DataObject
}
}
- $hints = array('webfinger' => $addr,
- 'profileurl' => $profileUrl,
- 'feedurl' => $feedUrl,
- 'salmon' => $salmonEndpoint);
-
if (isset($hcardUrl)) {
$hcardHints = self::slurpHcard($hcardUrl);
// Note: Webfinger > hcard