mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 02:35:12 +00:00
allow stuff with Diaspora authors to federate in zot conversations even if the local site has diaspora disabled. This way it won't look like folks are talking to themselves.
This commit is contained in:
parent
1659e0e7ad
commit
ca2bf76b06
4 changed files with 25 additions and 2 deletions
|
@ -118,6 +118,12 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false)
|
|||
}
|
||||
}
|
||||
else {
|
||||
if(! ($is_http)) {
|
||||
if(! intval(get_config('system','diaspora_enabled'))) {
|
||||
$result['message'] = t('Protocol disabled.');
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
$my_perms = 0;
|
||||
$their_perms = 0;
|
||||
|
|
|
@ -871,6 +871,8 @@ function import_author_xchan($x) {
|
|||
if((! array_key_exists('network', $x)) || ($x['network'] === 'zot')) {
|
||||
$y = import_author_zot($x);
|
||||
}
|
||||
if(! $y)
|
||||
$y = import_author_diaspora($x);
|
||||
|
||||
if($x['network'] === 'rss') {
|
||||
$y = import_author_rss($x);
|
||||
|
@ -879,6 +881,21 @@ function import_author_xchan($x) {
|
|||
return(($y) ? $y : false);
|
||||
}
|
||||
|
||||
|
||||
function import_author_diaspora($x) {
|
||||
if(! $x['address'])
|
||||
return false;
|
||||
if(discover_by_webbie($x['address'])) {
|
||||
$r = q("select xchan_hash from xchan where xchan_addr = '%s' limit 1",
|
||||
dbesc($x['address'])
|
||||
);
|
||||
if($r)
|
||||
return $r[0]['xchan_hash'];
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function import_author_rss($x) {
|
||||
|
||||
if(! $x['url'])
|
||||
|
|
|
@ -1033,7 +1033,7 @@ function discover_by_webbie($webbie) {
|
|||
}
|
||||
}
|
||||
|
||||
if($diaspora && $diaspora_base && $diaspora_guid && intval(get_config('system','diaspora_enabled'))) {
|
||||
if($diaspora && $diaspora_base && $diaspora_guid) {
|
||||
$guid = $diaspora_guid;
|
||||
$diaspora_base = trim($diaspora_base,'/');
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
2014-09-03.787
|
||||
2014-09-04.788
|
||||
|
|
Loading…
Reference in a new issue