Fix missing group size limit warnings.

This commit is contained in:
jeffrey-signal
2025-11-12 12:43:08 -05:00
committed by Alex Hart
parent bca406c8d3
commit ccdec5113f
3 changed files with 24 additions and 19 deletions

View File

@@ -25,7 +25,8 @@ class ContactChipViewModel : ViewModel() {
.distinctUntilChanged() .distinctUntilChanged()
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
val count = store.state.size val count: Int
get() = store.state.size
private val disposables = CompositeDisposable() private val disposables = CompositeDisposable()
private val disposableMap: MutableMap<RecipientId, Disposable> = mutableMapOf() private val disposableMap: MutableMap<RecipientId, Disposable> = mutableMapOf()

View File

@@ -9,21 +9,25 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import org.thoughtcrime.securesms.R; import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.util.RemoteConfig; import org.thoughtcrime.securesms.util.RemoteConfig;
import java.text.NumberFormat;
public final class GroupLimitDialog { public final class GroupLimitDialog {
public static void showHardLimitMessage(@NonNull Context context) { public static void showHardLimitMessage(@NonNull Context context) {
String formattedLimit = NumberFormat.getInstance().format(RemoteConfig.groupLimits().getHardLimit());
new MaterialAlertDialogBuilder(context) new MaterialAlertDialogBuilder(context)
.setTitle(R.string.ContactSelectionListFragment_maximum_group_size_reached) .setTitle(R.string.ContactSelectionListFragment_maximum_group_size_reached)
.setMessage(context.getString(R.string.ContactSelectionListFragment_signal_groups_can_have_a_maximum_of_d_members, RemoteConfig.groupLimits().getHardLimit())) .setMessage(context.getString(R.string.ContactSelectionListFragment_signal_groups_can_have_a_maximum_of_s_members, formattedLimit))
.setPositiveButton(android.R.string.ok, null) .setPositiveButton(android.R.string.ok, null)
.show(); .show();
} }
public static void showRecommendedLimitMessage(@NonNull Context context) { public static void showRecommendedLimitMessage(@NonNull Context context) {
String formattedLimit = NumberFormat.getInstance().format(RemoteConfig.groupLimits().getRecommendedLimit());
new MaterialAlertDialogBuilder(context) new MaterialAlertDialogBuilder(context)
.setTitle(R.string.ContactSelectionListFragment_recommended_member_limit_reached) .setTitle(R.string.ContactSelectionListFragment_recommended_member_limit_reached)
.setMessage(context.getString(R.string.ContactSelectionListFragment_signal_groups_perform_best_with_d_members_or_fewer, RemoteConfig.groupLimits().getRecommendedLimit())) .setMessage(context.getString(R.string.ContactSelectionListFragment_signal_groups_perform_best_with_s_members_or_fewer, formattedLimit))
.setPositiveButton(android.R.string.ok, null) .setPositiveButton(android.R.string.ok, null)
.show(); .show();
} }
} }

View File

@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
~ Copyright 2024 Signal Messenger, LLC ~ Copyright 2024 Signal Messenger, LLC
~ SPDX-License-Identifier: AGPL-3.0-only ~ SPDX-License-Identifier: AGPL-3.0-only
@@ -1906,20 +1907,20 @@
<!-- GV2 invitation revokes --> <!-- GV2 invitation revokes -->
<plurals name="MessageRecord_you_revoked_invites"> <plurals name="MessageRecord_you_revoked_invites">
<item quantity="one">You revoked an invitation to the group.</item> <item quantity="one">You revoked an invitation to the group.</item>
<item quantity="other">You revoked %1$d invitations to the group.</item> <item quantity="other">You revoked %1$d invitations to the group.</item>
</plurals> </plurals>
<plurals name="MessageRecord_s_revoked_invites"> <plurals name="MessageRecord_s_revoked_invites">
<item quantity="one">%1$s revoked an invitation to the group.</item> <item quantity="one">%1$s revoked an invitation to the group.</item>
<item quantity="other">%1$s revoked %2$d invitations to the group.</item> <item quantity="other">%1$s revoked %2$d invitations to the group.</item>
</plurals> </plurals>
<string name="MessageRecord_someone_declined_an_invitation_to_the_group">Someone declined an invitation to the group.</string> <string name="MessageRecord_someone_declined_an_invitation_to_the_group">Someone declined an invitation to the group.</string>
<string name="MessageRecord_you_declined_the_invitation_to_the_group">You declined the invitation to the group.</string> <string name="MessageRecord_you_declined_the_invitation_to_the_group">You declined the invitation to the group.</string>
<string name="MessageRecord_s_revoked_your_invitation_to_the_group">%1$s revoked your invitation to the group.</string> <string name="MessageRecord_s_revoked_your_invitation_to_the_group">%1$s revoked your invitation to the group.</string>
<string name="MessageRecord_an_admin_revoked_your_invitation_to_the_group">An admin revoked your invitation to the group.</string> <string name="MessageRecord_an_admin_revoked_your_invitation_to_the_group">An admin revoked your invitation to the group.</string>
<plurals name="MessageRecord_d_invitations_were_revoked"> <plurals name="MessageRecord_d_invitations_were_revoked">
<item quantity="one">An invitation to the group was revoked.</item> <item quantity="one">An invitation to the group was revoked.</item>
<item quantity="other">%1$d invitations to the group were revoked.</item> <item quantity="other">%1$d invitations to the group were revoked.</item>
</plurals> </plurals>
<!-- GV2 invitation acceptance --> <!-- GV2 invitation acceptance -->
@@ -3435,9 +3436,9 @@
<string name="ContactSelectionListFragment_s_is_not_a_signal_user">"%1$s" is not a Signal user. Please check the username and try again.</string> <string name="ContactSelectionListFragment_s_is_not_a_signal_user">"%1$s" is not a Signal user. Please check the username and try again.</string>
<string name="ContactSelectionListFragment_you_do_not_need_to_add_yourself_to_the_group">You do not need to add yourself to the group</string> <string name="ContactSelectionListFragment_you_do_not_need_to_add_yourself_to_the_group">You do not need to add yourself to the group</string>
<string name="ContactSelectionListFragment_maximum_group_size_reached">Maximum group size reached</string> <string name="ContactSelectionListFragment_maximum_group_size_reached">Maximum group size reached</string>
<string name="ContactSelectionListFragment_signal_groups_can_have_a_maximum_of_d_members">Signal groups can have a maximum of %1$d members.</string> <string name="ContactSelectionListFragment_signal_groups_can_have_a_maximum_of_s_members">Signal groups can have a maximum of %1$s members.</string>
<string name="ContactSelectionListFragment_recommended_member_limit_reached">Recommended member limit reached</string> <string name="ContactSelectionListFragment_recommended_member_limit_reached">Recommended member limit reached</string>
<string name="ContactSelectionListFragment_signal_groups_perform_best_with_d_members_or_fewer">Signal groups perform best with %1$d members or fewer. Adding more members will cause delays sending and receiving messages.</string> <string name="ContactSelectionListFragment_signal_groups_perform_best_with_s_members_or_fewer">Signal groups perform best with %1$s members or fewer. Adding more members will cause delays sending and receiving messages.</string>
<plurals name="ContactSelectionListFragment_d_members"> <plurals name="ContactSelectionListFragment_d_members">
<item quantity="one">%1$d member</item> <item quantity="one">%1$d member</item>
<item quantity="other">%1$d members</item> <item quantity="other">%1$d members</item>
@@ -6026,7 +6027,7 @@
<!-- Dialog message when sending a story via an add to group story button --> <!-- Dialog message when sending a story via an add to group story button -->
<string name="MediaReviewFragment__add_to_the_group_story">Add to the group story \"%s\"</string> <string name="MediaReviewFragment__add_to_the_group_story">Add to the group story \"%s\"</string>
<!-- Positive dialog action when sending a story via an add to group story button --> <!-- Positive dialog action when sending a story via an add to group story button -->
<string name ="MediaReviewFragment__add_to_story">Add to story</string> <string name="MediaReviewFragment__add_to_story">Add to story</string>
<string name="MediaReviewFragment__add_a_message">Add a message</string> <string name="MediaReviewFragment__add_a_message">Add a message</string>
<!-- Hint text inside of a compose box that is shown when the user is adding media while quoting a message. --> <!-- Hint text inside of a compose box that is shown when the user is adding media while quoting a message. -->
<string name="MediaReviewFragment__add_a_reply">Add a reply</string> <string name="MediaReviewFragment__add_a_reply">Add a reply</string>
@@ -6120,7 +6121,6 @@
<string name="BadgesOverviewFragment__failed_to_update_profile">Failed to update profile</string> <string name="BadgesOverviewFragment__failed_to_update_profile">Failed to update profile</string>
<string name="SelectFeaturedBadgeFragment__select_a_badge">Select a badge</string> <string name="SelectFeaturedBadgeFragment__select_a_badge">Select a badge</string>
<string name="SelectFeaturedBadgeFragment__you_must_select_a_badge">You must select a badge</string> <string name="SelectFeaturedBadgeFragment__you_must_select_a_badge">You must select a badge</string>
<string name="SelectFeaturedBadgeFragment__failed_to_update_profile">Failed to update profile</string> <string name="SelectFeaturedBadgeFragment__failed_to_update_profile">Failed to update profile</string>