Changed toast to warning - although condition to trigger should not be possible

This commit is contained in:
alansley 2024-08-28 14:02:54 +10:00
parent 413bc0be4b
commit 736b5313e6

View File

@ -310,10 +310,11 @@ class EditClosedGroupActivity : PassphraseRequiredActionBarActivity() {
val userPublicKey = TextSecurePreferences.getLocalNumber(this)!! val userPublicKey = TextSecurePreferences.getLocalNumber(this)!!
val userAsRecipient = Recipient.from(this, Address.fromSerialized(userPublicKey), false) val userAsRecipient = Recipient.from(this, Address.fromSerialized(userPublicKey), false)
// There's presently way in the UI to get into the state whereby you could remove yourself from the group when removing any other members
// (you can't unselect yourself - the only way to leave is to "Leave Group" from the menu) - but it's possible that this was not always
// the case - so we can leave this in as defensive code in-case something goes screwy.
if (!members.contains(userAsRecipient) && !members.map { it.address.toString() }.containsAll(originalMembers.minus(userPublicKey))) { if (!members.contains(userAsRecipient) && !members.map { it.address.toString() }.containsAll(originalMembers.minus(userPublicKey))) {
// ACL TODO - Need a proper string for this return Log.w("EditClosedGroup", "Can't leave group while adding or removing other members.")
val message = "Can't leave while adding or removing other members."
return Toast.makeText(this@EditClosedGroupActivity, message, Toast.LENGTH_LONG).show()
} }
if (isClosedGroup) { if (isClosedGroup) {