aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2023-04-25 08:36:20 +0000
committerMario <mario@mariovavti.com>2023-04-25 08:36:20 +0000
commit09fde2f83904b3cff477bfedb466c894f06b2f32 (patch)
treeed2ce5ea6213675b92a6c30c5f7e6f2b536e7545
parent8a14e4261d3247dc02254cb91fdb9b82e051f324 (diff)
downloadvolse-hubzilla-09fde2f83904b3cff477bfedb466c894f06b2f32.tar.gz
volse-hubzilla-09fde2f83904b3cff477bfedb466c894f06b2f32.tar.bz2
volse-hubzilla-09fde2f83904b3cff477bfedb466c894f06b2f32.zip
correctly set some perms when our follow request was accepted
-rw-r--r--Zotlabs/Lib/Activity.php14
-rw-r--r--include/photos.php1
2 files changed, 10 insertions, 5 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index 23507bb2e..cb9d0f1b3 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -1333,7 +1333,8 @@ class Activity {
}
}
- $x = PermissionRoles::role_perms('personal');
+ $role = get_pconfig($channel['channel_id'], 'system', 'permissions_role', 'personal');
+ $x = PermissionRoles::role_perms($role);
$their_perms = Permissions::FilledPerms($x['perms_connect']);
if ($contact && $contact['abook_id']) {
@@ -1358,10 +1359,15 @@ class Activity {
return;
case 'Accept':
+ // They accepted our Follow request.
+ // Set default permissions except for send_stream and post_wall
- // They accepted our Follow request - set default permissions
-
- set_abconfig($channel['channel_id'], $contact['abook_xchan'], 'system', 'their_perms', $their_perms);
+ foreach ($their_perms as $k => $v) {
+ if(in_array($k, ['send_stream', 'post_wall'])) {
+ $v = 0; // Those will be set once we accept their follow request
+ }
+ set_abconfig($channel['channel_id'], $contact['abook_xchan'], 'their_perms', $k, $v);
+ }
$abook_instance = $contact['abook_instance'];
diff --git a/include/photos.php b/include/photos.php
index 6e00ffbf0..8d83b8475 100644
--- a/include/photos.php
+++ b/include/photos.php
@@ -64,7 +64,6 @@ function photo_upload($channel, $observer, $args) {
}
$ac = $acl->get();
-hz_syslog(print_r($ac,true));
$width = $height = 0;
if ($args['getimagesize']) {