From 09fde2f83904b3cff477bfedb466c894f06b2f32 Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 25 Apr 2023 08:36:20 +0000 Subject: correctly set some perms when our follow request was accepted --- Zotlabs/Lib/Activity.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'Zotlabs') 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']; -- cgit v1.2.3