aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-03-19 01:19:11 -0700
committerFriendika <info@friendika.com>2011-03-19 01:19:11 -0700
commit7e33c1072a4a948941e2522afe0123899b0abddd (patch)
treec4c540e85b9c0b17f0a44cfc3d82bafb6bd0dad6
parent5034d7333eb849e9204d451a496f4fe2e019de62 (diff)
downloadvolse-hubzilla-7e33c1072a4a948941e2522afe0123899b0abddd.tar.gz
volse-hubzilla-7e33c1072a4a948941e2522afe0123899b0abddd.tar.bz2
volse-hubzilla-7e33c1072a4a948941e2522afe0123899b0abddd.zip
stuff to make connecting to diaspora profiles easier
-rw-r--r--boot.php12
-rw-r--r--include/items.php2
-rw-r--r--mod/follow.php14
3 files changed, 21 insertions, 7 deletions
diff --git a/boot.php b/boot.php
index aa40c1711..66d4bc124 100644
--- a/boot.php
+++ b/boot.php
@@ -1603,9 +1603,15 @@ function lrdd($uri) {
if(! function_exists('fetch_lrdd_template')) {
function fetch_lrdd_template($host) {
$tpl = '';
- $url = 'http://' . $host . '/.well-known/host-meta' ;
- $links = fetch_xrd_links($url);
-logger('template: ' . print_r($links,true));
+
+ $url1 = 'https://' . $host . '/.well-known/host-meta' ;
+ $url2 = 'http://' . $host . '/.well-known/host-meta' ;
+ $links = fetch_xrd_links($url1);
+ logger('template (https): ' . print_r($links,true));
+ if(! count($links)) {
+ $links = fetch_xrd_links($url2);
+ logger('template (http): ' . print_r($links,true));
+ }
if(count($links)) {
foreach($links as $link)
if($link['@attributes']['rel'] && $link['@attributes']['rel'] === 'lrdd')
diff --git a/include/items.php b/include/items.php
index 051659321..6900c5920 100644
--- a/include/items.php
+++ b/include/items.php
@@ -905,6 +905,8 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0) {
require_once('simplepie/simplepie.inc');
+ if(! $contact)
+ logger('consume feed: anonymous');
$feed = new SimplePie();
$feed->set_raw_data($xml);
if($datedir)
diff --git a/mod/follow.php b/mod/follow.php
index 689ae8232..4ce3ccb82 100644
--- a/mod/follow.php
+++ b/mod/follow.php
@@ -11,7 +11,7 @@ function follow_post(&$a) {
}
$url = $orig_url = notags(trim($_POST['url']));
-
+ $diaspora = false;
$email_conversant = false;
if($url) {
@@ -28,6 +28,9 @@ function follow_post(&$a) {
$hcard = unamp($link['@attributes']['href']);
if($link['@attributes']['rel'] === 'http://webfinger.net/rel/profile-page')
$profile = unamp($link['@attributes']['href']);
+ if($link['@attributes']['rel'] === 'http://joindiaspora.com/seed_location')
+ $diaspora = true;
+
}
@@ -90,9 +93,12 @@ function follow_post(&$a) {
}
}
- if(! $profile)
- $profile = $url;
-
+ if(! $profile) {
+ if($diaspora)
+ $profile = $hcard;
+ else
+ $profile = $url;
+ }
if(! x($vcard,'fn'))
if(x($vcard,'nick'))