follow activitypub by webfinger; requires addon update to all federation protocols
This commit is contained in:
parent
1ef31d27c7
commit
fa78dc79f3
@ -150,9 +150,9 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false)
|
|||||||
|
|
||||||
// attempt network auto-discovery
|
// 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
|
// 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",
|
$r = q("select * from xchan where xchan_hash = '%s' or xchan_url = '%s' limit 1",
|
||||||
dbesc($url),
|
dbesc(($wf) ? $wf : $url),
|
||||||
dbesc($url)
|
dbesc($url)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1192,9 +1192,10 @@ function discover_by_webbie($webbie, $protocol = '') {
|
|||||||
logger('webfinger: ' . print_r($x,true), LOGGER_DATA, LOG_INFO);
|
logger('webfinger: ' . print_r($x,true), LOGGER_DATA, LOG_INFO);
|
||||||
|
|
||||||
$arr = [
|
$arr = [
|
||||||
'address' => $webbie,
|
'address' => $webbie,
|
||||||
'protocol' => $protocol,
|
'protocol' => $protocol,
|
||||||
'success' => false,
|
'success' => false,
|
||||||
|
'xchan' => '',
|
||||||
'webfinger' => $x
|
'webfinger' => $x
|
||||||
];
|
];
|
||||||
/**
|
/**
|
||||||
@ -1207,7 +1208,7 @@ function discover_by_webbie($webbie, $protocol = '') {
|
|||||||
*/
|
*/
|
||||||
call_hooks('discover_channel_webfinger', $arr);
|
call_hooks('discover_channel_webfinger', $arr);
|
||||||
if($arr['success'])
|
if($arr['success'])
|
||||||
return true;
|
return $arr['xchan'];
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user