From 10554011f8b1873afa55fd87fecf41198cb9d2f1 Mon Sep 17 00:00:00 2001 From: Brice-W Date: Tue, 20 Apr 2021 09:39:51 +1000 Subject: [PATCH] avoid displaying self in the contacts list --- .../securesms/loki/activities/CreateClosedGroupActivity.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/loki/activities/CreateClosedGroupActivity.kt b/app/src/main/java/org/thoughtcrime/securesms/loki/activities/CreateClosedGroupActivity.kt index 2ad317bdba..bebbc58856 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/loki/activities/CreateClosedGroupActivity.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/loki/activities/CreateClosedGroupActivity.kt @@ -32,6 +32,10 @@ class CreateClosedGroupActivity : PassphraseRequiredActionBarActivity(), LoaderM set(newValue) { field = newValue; invalidateOptionsMenu() } private var members = listOf() set(value) { field = value; selectContactsAdapter.members = value } + private val publicKey: String + get() { + return TextSecurePreferences.getLocalNumber(this)!! + } private val selectContactsAdapter by lazy { SelectContactsAdapter(this, GlideApp.with(this)) @@ -72,7 +76,7 @@ class CreateClosedGroupActivity : PassphraseRequiredActionBarActivity(), LoaderM } private fun update(members: List) { - this.members = members + this.members = members.minus(publicKey) mainContentContainer.visibility = if (members.isEmpty()) View.GONE else View.VISIBLE emptyStateContainer.visibility = if (members.isEmpty()) View.VISIBLE else View.GONE invalidateOptionsMenu()