- 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:
Ty Clifford
2026-06-08 16:47:02 -04:00
parent 2881a3b338
commit de8ec43aa4
9 changed files with 107 additions and 42 deletions
+12 -4
View File
@@ -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(),
]);