Cleaned up a few comments and fixed some plurals logic

This commit is contained in:
alansley
2024-08-06 14:12:10 +10:00
parent be400d8f4f
commit a8d72dfcc0
4 changed files with 15 additions and 15 deletions

View File

@@ -521,9 +521,9 @@ public class DefaultMessageNotifier implements MessageNotifier {
// If we received some manner of notification but Session is locked..
} else if (KeyCachingService.isLocked(context)) {
// Note: We provide 0 because `messageNewYouveGot` is now a plurals string and we don't have a count yet, so just
// giving it zero will result in "You got a new message".
body = SpanUtil.italic(context.getResources().getQuantityString(R.plurals.messageNewYouveGot, 0, 0));
// Note: We provide 1 because `messageNewYouveGot` is now a plurals string and we don't have a count yet, so just
// giving it 1 will result in "You got a new message".
body = SpanUtil.italic(context.getResources().getQuantityString(R.plurals.messageNewYouveGot, 1, 1));
// ----- All further cases assume we know the contact and that Session isn't locked -----

View File

@@ -56,8 +56,8 @@ class PushReceiver @Inject constructor(@ApplicationContext val context: Context)
.setColor(context.getColor(R.color.textsecure_primary))
.setContentTitle(getString(context, R.string.sessionMessenger))
// Note: We set the count to zero in the below plurals string so it says "You've got a new message" (singular)
.setContentText(context.resources.getQuantityString(R.plurals.messageNewYouveGot, 0, 0))
// Note: We set the count to 1 in the below plurals string so it says "You've got a new message" (singular)
.setContentText(context.resources.getQuantityString(R.plurals.messageNewYouveGot, 1, 1))
.setPriority(NotificationCompat.PRIORITY_DEFAULT)
.setAutoCancel(true)