aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-02-22 19:56:28 -0800
committerfriendica <info@friendica.com>2012-02-22 19:56:28 -0800
commitf9eddad44f9eb31b8eab2f783c6892e1f929386b (patch)
treec47e0ba7acea28198e9dd96bea59e90ff72176a8
parent390eb15e7d00a0616d73cc86595182f099639644 (diff)
downloadvolse-hubzilla-f9eddad44f9eb31b8eab2f783c6892e1f929386b.tar.gz
volse-hubzilla-f9eddad44f9eb31b8eab2f783c6892e1f929386b.tar.bz2
volse-hubzilla-f9eddad44f9eb31b8eab2f783c6892e1f929386b.zip
allow forum posts by followers on Diaspora
-rwxr-xr-xboot.php2
-rwxr-xr-xinclude/diaspora.php26
2 files changed, 20 insertions, 8 deletions
diff --git a/boot.php b/boot.php
index 79a925961..9e40b81dc 100755
--- a/boot.php
+++ b/boot.php
@@ -9,7 +9,7 @@ require_once('include/nav.php');
require_once('include/cache.php');
define ( 'FRIENDICA_PLATFORM', 'Friendica');
-define ( 'FRIENDICA_VERSION', '2.3.1259' );
+define ( 'FRIENDICA_VERSION', '2.3.1260' );
define ( 'DFRN_PROTOCOL_VERSION', '2.22' );
define ( 'DB_UPDATE_VERSION', 1123 );
diff --git a/include/diaspora.php b/include/diaspora.php
index a8e02e509..92f3500f2 100755
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -451,7 +451,7 @@ function diaspora_request($importer,$xml) {
// perhaps we were already sharing with this person. Now they're sharing with us.
// That makes us friends.
- if($contact['rel'] == CONTACT_IS_FOLLOWER) {
+ if($contact['rel'] == CONTACT_IS_FOLLOWER && $importer['page-flags'] != PAGE_COMMUNITY) {
q("UPDATE `contact` SET `rel` = %d, `writable` = 1 WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval(CONTACT_IS_FRIEND),
intval($contact['id']),
@@ -619,6 +619,18 @@ function diaspora_request($importer,$xml) {
return;
}
+function diaspora_post_allow($importer,$contact) {
+ if(($contact['blocked']) || ($contact['readonly']))
+ return false;
+ if($contact['rel'] == CONTACT_IS_SHARING || $contact['rel'] == CONTACT_IS_FRIEND)
+ return true;
+ if($contact['rel'] == CONTACT_IS_FOLLOWER)
+ if($importer['page-flags'] == PAGE_COMMUNITY)
+ return true;
+ return false;
+}
+
+
function diaspora_post($importer,$xml) {
$a = get_app();
@@ -629,7 +641,7 @@ function diaspora_post($importer,$xml) {
if(! $contact)
return;
- if(($contact['rel'] == CONTACT_IS_FOLLOWER) || ($contact['blocked']) || ($contact['readonly'])) {
+ if(! diaspora_post_allow($importer,$contact)) {
logger('diaspora_post: Ignoring this author.');
return 202;
}
@@ -748,7 +760,7 @@ function diaspora_reshare($importer,$xml) {
if(! $contact)
return;
- if(($contact['rel'] == CONTACT_IS_FOLLOWER) || ($contact['blocked']) || ($contact['readonly'])) {
+ if(! diaspora_post_allow($importer,$contact)) {
logger('diaspora_reshare: Ignoring this author: ' . $diaspora_handle . ' ' . print_r($xml,true));
return 202;
}
@@ -900,7 +912,7 @@ function diaspora_asphoto($importer,$xml) {
if(! $contact)
return;
- if(($contact['rel'] == CONTACT_IS_FOLLOWER) || ($contact['blocked']) || ($contact['readonly'])) {
+ if(! diaspora_post_allow($importer,$contact)) {
logger('diaspora_asphoto: Ignoring this author.');
return 202;
}
@@ -1001,7 +1013,7 @@ function diaspora_comment($importer,$xml,$msg) {
return;
}
- if(($contact['rel'] == CONTACT_IS_FOLLOWER) || ($contact['blocked']) || ($contact['readonly'])) {
+ if(! diaspora_post_allow($importer,$contact)) {
logger('diaspora_comment: Ignoring this author.');
return 202;
}
@@ -1446,7 +1458,7 @@ function diaspora_photo($importer,$xml,$msg) {
return;
}
- if(($contact['rel'] == CONTACT_IS_FOLLOWER) || ($contact['blocked']) || ($contact['readonly'])) {
+ if(! diaspora_post_allow($importer,$contact)) {
logger('diaspora_photo: Ignoring this author.');
return 202;
}
@@ -1503,7 +1515,7 @@ function diaspora_like($importer,$xml,$msg) {
return;
}
- if(($contact['rel'] == CONTACT_IS_FOLLOWER) || ($contact['blocked']) || ($contact['readonly'])) {
+ if(! diaspora_post_allow($importer,$contact)) {
logger('diaspora_like: Ignoring this author.');
return 202;
}