aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-09-04 01:13:01 -0700
committerfriendica <info@friendica.com>2014-09-04 01:13:01 -0700
commitca2bf76b06360d6bd3dc386d53c6d7301cd518f3 (patch)
treef9997ba76aeb1e6ed3d772f54ab7062e3cab711a
parent1659e0e7ad5511bb2f1d786b5dd5dd10000eabf7 (diff)
downloadvolse-hubzilla-ca2bf76b06360d6bd3dc386d53c6d7301cd518f3.tar.gz
volse-hubzilla-ca2bf76b06360d6bd3dc386d53c6d7301cd518f3.tar.bz2
volse-hubzilla-ca2bf76b06360d6bd3dc386d53c6d7301cd518f3.zip
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.
-rw-r--r--include/follow.php6
-rwxr-xr-xinclude/items.php17
-rw-r--r--include/network.php2
-rw-r--r--version.inc2
4 files changed, 25 insertions, 2 deletions
diff --git a/include/follow.php b/include/follow.php
index e6c42aad1..058f5d60b 100644
--- a/include/follow.php
+++ b/include/follow.php
@@ -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;
diff --git a/include/items.php b/include/items.php
index 9d80b3a81..acdae90b2 100755
--- a/include/items.php
+++ b/include/items.php
@@ -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'])
diff --git a/include/network.php b/include/network.php
index 5ca60b5fe..5ad391491 100644
--- a/include/network.php
+++ b/include/network.php
@@ -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,'/');
diff --git a/version.inc b/version.inc
index f8b14f55a..ae902fed0 100644
--- a/version.inc
+++ b/version.inc
@@ -1 +1 @@
-2014-09-03.787
+2014-09-04.788