- Fixed. The missing controls now appear at:
Plans & Platform > Plans, Prices & Entitlements > Groups Available for each tier. Config > Feature Availability > Groups Enabled as the global master switch.
This commit is contained in:
+12
-4
@@ -33,8 +33,15 @@ function messagePayload(array $row): array {
|
||||
|
||||
function requestedGroup(array $user): ?int {
|
||||
$groupId = normalizeGroupId($_POST['group_id'] ?? $_GET['group_id'] ?? null);
|
||||
if ($groupId !== null && !groupsEnabled()) {
|
||||
jsonResponse(['error' => 'Private groups are currently disabled', 'groups_enabled' => false], 403);
|
||||
if ($groupId !== null && !groupsAvailableForUser($user)) {
|
||||
$error = groupsEnabled()
|
||||
? 'Private groups are not available on your tier'
|
||||
: 'Private groups are currently disabled';
|
||||
jsonResponse([
|
||||
'error' => $error,
|
||||
'groups_enabled' => false,
|
||||
'groups_platform_enabled' => groupsEnabled(),
|
||||
], 403);
|
||||
}
|
||||
requireGroupAccess($user, $groupId);
|
||||
return $groupId;
|
||||
@@ -174,8 +181,9 @@ function pollMessages(): never {
|
||||
'messages' => array_map('messagePayload', $rows),
|
||||
'online' => (int)$onlineStmt->fetchColumn(),
|
||||
'recording' => $recording,
|
||||
'groups' => groupsEnabled() ? userGroups((int)$user['id']) : [],
|
||||
'groups_enabled' => groupsEnabled(),
|
||||
'groups' => groupsAvailableForUser($user) ? userGroups((int)$user['id']) : [],
|
||||
'groups_enabled' => groupsAvailableForUser($user),
|
||||
'groups_platform_enabled' => groupsEnabled(),
|
||||
'group_id' => $groupId,
|
||||
'server_time' => time(),
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user