add group limit size

This commit is contained in:
otsmr 2026-01-17 17:05:14 +01:00
parent f24d91e313
commit e824f4cd87
6 changed files with 31 additions and 1 deletions

View file

@ -2931,6 +2931,12 @@ abstract class AppLocalizations {
/// In en, this message translates to: /// In en, this message translates to:
/// **'You can only delete the contact once the direct chat has been deleted and the contact is no longer a member of a group.'** /// **'You can only delete the contact once the direct chat has been deleted and the contact is no longer a member of a group.'**
String get deleteUserErrorMessage; String get deleteUserErrorMessage;
/// No description provided for @groupSizeLimitError.
///
/// In en, this message translates to:
/// **'Currently, group size is limited to {size} people!'**
String groupSizeLimitError(Object size);
} }
class _AppLocalizationsDelegate class _AppLocalizationsDelegate

View file

@ -1631,4 +1631,9 @@ class AppLocalizationsDe extends AppLocalizations {
@override @override
String get deleteUserErrorMessage => String get deleteUserErrorMessage =>
'Du kannst den Kontakt erst löschen, wenn der direkte Chat gelöscht wurde und der Kontakt nicht mehr Mitglied einer Gruppe ist.'; 'Du kannst den Kontakt erst löschen, wenn der direkte Chat gelöscht wurde und der Kontakt nicht mehr Mitglied einer Gruppe ist.';
@override
String groupSizeLimitError(Object size) {
return 'Derzeit ist die Gruppengröße auf $size Personen begrenzt!';
}
} }

View file

@ -1619,4 +1619,9 @@ class AppLocalizationsEn extends AppLocalizations {
@override @override
String get deleteUserErrorMessage => String get deleteUserErrorMessage =>
'You can only delete the contact once the direct chat has been deleted and the contact is no longer a member of a group.'; 'You can only delete the contact once the direct chat has been deleted and the contact is no longer a member of a group.';
@override
String groupSizeLimitError(Object size) {
return 'Currently, group size is limited to $size people!';
}
} }

View file

@ -1619,4 +1619,9 @@ class AppLocalizationsSv extends AppLocalizations {
@override @override
String get deleteUserErrorMessage => String get deleteUserErrorMessage =>
'You can only delete the contact once the direct chat has been deleted and the contact is no longer a member of a group.'; 'You can only delete the contact once the direct chat has been deleted and the contact is no longer a member of a group.';
@override
String groupSizeLimitError(Object size) {
return 'Currently, group size is limited to $size people!';
}
} }

@ -1 +1 @@
Subproject commit 4096b342802fc07be92070c7db6f46353790876b Subproject commit 471fed328ff1bf9316e9b86456ecdd68f4cfabca

View file

@ -84,6 +84,15 @@ class _StartNewChatView extends State<GroupCreateSelectMembersView> {
void toggleSelectedUser(int userId) { void toggleSelectedUser(int userId) {
if (alreadyInGroup.contains(userId)) return; if (alreadyInGroup.contains(userId)) return;
if (!selectedUsers.contains(userId)) { if (!selectedUsers.contains(userId)) {
if (selectedUsers.length + alreadyInGroup.length > 256) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(context.lang.groupSizeLimitError(256)),
duration: const Duration(seconds: 3),
),
);
return;
}
selectedUsers.add(userId); selectedUsers.add(userId);
} else { } else {
selectedUsers.remove(userId); selectedUsers.remove(userId);