aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-04-18 19:41:09 -0700
committerMario Vavti <mario@mariovavti.com>2018-04-19 08:44:41 +0200
commitfa78dc79f3f384918a267344920f5802e68ad828 (patch)
tree1b6b5654f8233acc64b200b590ae23fa0c0562e2
parent1ef31d27c7b37b933f7fd0f7977d23ee186204d5 (diff)
downloadvolse-hubzilla-fa78dc79f3f384918a267344920f5802e68ad828.tar.gz
volse-hubzilla-fa78dc79f3f384918a267344920f5802e68ad828.tar.bz2
volse-hubzilla-fa78dc79f3f384918a267344920f5802e68ad828.zip
follow activitypub by webfinger; requires addon update to all federation protocols
-rw-r--r--include/follow.php8
-rw-r--r--include/network.php9
2 files changed, 9 insertions, 8 deletions
diff --git a/include/follow.php b/include/follow.php
index a63fe66ea..d803afa3f 100644
--- a/include/follow.php
+++ b/include/follow.php
@@ -150,9 +150,9 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false)
// attempt network auto-discovery
- $d = discover_by_webbie($url,$protocol);
+ $wf = discover_by_webbie($url,$protocol);
- if((! $d) && ($is_http)) {
+ if((! $wf) && ($is_http)) {
// try RSS discovery
@@ -167,9 +167,9 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false)
}
}
- if($d) {
+ if($wf || $d) {
$r = q("select * from xchan where xchan_hash = '%s' or xchan_url = '%s' limit 1",
- dbesc($url),
+ dbesc(($wf) ? $wf : $url),
dbesc($url)
);
}
diff --git a/include/network.php b/include/network.php
index 897fbccd6..c41d87af0 100644
--- a/include/network.php
+++ b/include/network.php
@@ -1192,9 +1192,10 @@ function discover_by_webbie($webbie, $protocol = '') {
logger('webfinger: ' . print_r($x,true), LOGGER_DATA, LOG_INFO);
$arr = [
- 'address' => $webbie,
- 'protocol' => $protocol,
- 'success' => false,
+ 'address' => $webbie,
+ 'protocol' => $protocol,
+ 'success' => false,
+ 'xchan' => '',
'webfinger' => $x
];
/**
@@ -1207,7 +1208,7 @@ function discover_by_webbie($webbie, $protocol = '') {
*/
call_hooks('discover_channel_webfinger', $arr);
if($arr['success'])
- return true;
+ return $arr['xchan'];
return false;
}