mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 17:29:32 +01:00
Fix miscalculation of groups in common.
This commit is contained in:
committed by
Greyson Parrelli
parent
6759b59507
commit
e2c3db3eda
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user