aboutsummaryrefslogtreecommitdiffstats
path: root/include/diaspora.php
diff options
context:
space:
mode:
authorHabeas Codice <habeascodice@federated.social>2014-11-13 13:06:31 -0800
committerHabeas Codice <habeascodice@federated.social>2014-11-13 13:06:31 -0800
commitac27db22c18ee7a82a52cbadb3efe2760b910499 (patch)
treeaa7002d73dbcd4136033589f1cb135184f4126c1 /include/diaspora.php
parent1a5a5c7edb8697c93f8bababbafa80245378dd7e (diff)
parent109cb936632c693d3f24afb9e2ce533797ad1a7f (diff)
downloadvolse-hubzilla-ac27db22c18ee7a82a52cbadb3efe2760b910499.tar.gz
volse-hubzilla-ac27db22c18ee7a82a52cbadb3efe2760b910499.tar.bz2
volse-hubzilla-ac27db22c18ee7a82a52cbadb3efe2760b910499.zip
Merge remote-tracking branch 'upstream/master'
Conflicts: boot.php include/dba/dba_driver.php include/diaspora.php include/follow.php include/session.php include/zot.php mod/photos.php mod/ping.php
Diffstat (limited to 'include/diaspora.php')
-rwxr-xr-xinclude/diaspora.php21
1 files changed, 10 insertions, 11 deletions
diff --git a/include/diaspora.php b/include/diaspora.php
index 81ed9f3ab..09521b82b 100755
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -58,7 +58,7 @@ function diaspora_dispatch($importer,$msg,$attempt=1) {
$xmlbase = $parsed_xml->post;
- logger('diaspora_dispatch: ' . print_r($xmlbase,true), LOGGER_DATA);
+// logger('diaspora_dispatch: ' . print_r($xmlbase,true), LOGGER_DATA);
if($xmlbase->request) {
@@ -673,16 +673,15 @@ function diaspora_request($importer,$xml) {
return;
}
- $default_perms = 0;
- // look for default permissions to apply in return - e.g. auto-friend
- $z = q("select * from abook where abook_channel = %d and (abook_flags & %d)>0 limit 1",
- intval($importer['channel_id']),
- intval(ABOOK_FLAG_SELF)
- );
-
- if($z)
- $default_perms = intval($z[0]['abook_my_perms']);
-
+ $role = get_pconfig($channel['channel_id'],'system','permissions_role');
+ if($role) {
+ $x = get_role_perms($role);
+ if($x['perms_auto'])
+ $default_perms = $x['perms_accept'];
+ }
+ if(! $default_perms)
+ $default_perms = intval(get_pconfig($channel['channel_id'],'system','autoperms'));
+
$their_perms = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_PHOTOS|PERMS_R_ABOOK|PERMS_W_STREAM|PERMS_W_COMMENT|PERMS_W_MAIL|PERMS_W_CHAT|PERMS_R_STORAGE|PERMS_R_PAGES;
$r = q("insert into abook ( abook_account, abook_channel, abook_xchan, abook_my_perms, abook_their_perms, abook_closeness, abook_rating, abook_created, abook_updated, abook_connected, abook_dob, abook_flags) values ( %d, %d, '%s', %d, %d, %d, %d, '%s', '%s', '%s', '%s', %d )",