Fix miscalculation of groups in common.

This commit is contained in:
Alex Hart
2023-02-15 14:11:24 -04:00
committed by Greyson Parrelli
parent 6759b59507
commit e2c3db3eda
7 changed files with 141 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
package org.thoughtcrime.securesms.contacts.paged
import android.content.Context
import org.signal.core.util.logging.Log
import org.thoughtcrime.securesms.R
/**
@@ -12,6 +13,10 @@ data class GroupsInCommon(
) {
fun toDisplayText(context: Context): String {
return when (total) {
0 -> {
Log.w(TAG, "Member with no groups in common!")
return ""
}
1 -> context.getString(R.string.MessageRequestProfileView_member_of_one_group, names[0])
2 -> context.getString(R.string.MessageRequestProfileView_member_of_two_groups, names[0], names[1])
else -> context.getString(
@@ -22,4 +27,8 @@ data class GroupsInCommon(
)
}
}
companion object {
private val TAG = Log.tag(GroupsInCommon::class.java)
}
}