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 );
// 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']),
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();
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}