From 06ea000f42baba6cad9b65682a205ee4c0755b78 Mon Sep 17 00:00:00 2001 From: Alan Evans Date: Tue, 7 May 2019 12:26:01 -0300 Subject: [PATCH] Repeat count for format args of plural string. Fixes #8724 --- src/org/thoughtcrime/securesms/util/IdentityUtil.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/org/thoughtcrime/securesms/util/IdentityUtil.java b/src/org/thoughtcrime/securesms/util/IdentityUtil.java index 74aab01c1a..de458f9ce8 100644 --- a/src/org/thoughtcrime/securesms/util/IdentityUtil.java +++ b/src/org/thoughtcrime/securesms/util/IdentityUtil.java @@ -243,13 +243,8 @@ public class IdentityUtil { if (recipients.size() == 2) { return context.getString(resourceTwo, firstName, secondName); } else { - String nMore; - - if (recipients.size() == 3) { - nMore = context.getResources().getQuantityString(R.plurals.identity_others, 1); - } else { - nMore = context.getResources().getQuantityString(R.plurals.identity_others, recipients.size() - 2); - } + int othersCount = recipients.size() - 2; + String nMore = context.getResources().getQuantityString(R.plurals.identity_others, othersCount, othersCount); return context.getString(resourceMany, firstName, secondName, nMore); }