mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-29 04:55:15 +00:00
refactor: disable edit text for non contacts
This commit is contained in:
parent
ad09888c80
commit
5a2dac38c6
@ -60,6 +60,7 @@ class UserDetailsBottomSheet: BottomSheetDialogFragment() {
|
|||||||
profilePictureView.root.update(recipient)
|
profilePictureView.root.update(recipient)
|
||||||
nameTextViewContainer.visibility = View.VISIBLE
|
nameTextViewContainer.visibility = View.VISIBLE
|
||||||
nameTextViewContainer.setOnClickListener {
|
nameTextViewContainer.setOnClickListener {
|
||||||
|
if (recipient.isOpenGroupInboxRecipient) return@setOnClickListener
|
||||||
nameTextViewContainer.visibility = View.INVISIBLE
|
nameTextViewContainer.visibility = View.INVISIBLE
|
||||||
nameEditTextContainer.visibility = View.VISIBLE
|
nameEditTextContainer.visibility = View.VISIBLE
|
||||||
nicknameEditText.text = null
|
nicknameEditText.text = null
|
||||||
@ -86,6 +87,8 @@ class UserDetailsBottomSheet: BottomSheetDialogFragment() {
|
|||||||
}
|
}
|
||||||
nameTextView.text = recipient.name ?: publicKey // Uses the Contact API internally
|
nameTextView.text = recipient.name ?: publicKey // Uses the Contact API internally
|
||||||
|
|
||||||
|
nameEditIcon.isVisible = threadRecipient.isContactRecipient
|
||||||
|
|
||||||
publicKeyTextView.isVisible = !threadRecipient.isOpenGroupRecipient && !threadRecipient.isOpenGroupInboxRecipient
|
publicKeyTextView.isVisible = !threadRecipient.isOpenGroupRecipient && !threadRecipient.isOpenGroupInboxRecipient
|
||||||
messageButton.isVisible = !threadRecipient.isOpenGroupRecipient || IdPrefix.fromValue(publicKey) == IdPrefix.BLINDED
|
messageButton.isVisible = !threadRecipient.isOpenGroupRecipient || IdPrefix.fromValue(publicKey) == IdPrefix.BLINDED
|
||||||
publicKeyTextView.text = publicKey
|
publicKeyTextView.text = publicKey
|
||||||
|
@ -117,7 +117,7 @@ class MessageRequestsActivity : PassphraseRequiredActionBarActivity(), Conversat
|
|||||||
val dialog = AlertDialog.Builder(this)
|
val dialog = AlertDialog.Builder(this)
|
||||||
dialog.setMessage(resources.getString(R.string.message_requests_clear_all_message))
|
dialog.setMessage(resources.getString(R.string.message_requests_clear_all_message))
|
||||||
dialog.setPositiveButton(R.string.yes) { _, _ ->
|
dialog.setPositiveButton(R.string.yes) { _, _ ->
|
||||||
viewModel.clearAllMessageRequests()
|
viewModel.clearAllMessageRequests(true)
|
||||||
LoaderManager.getInstance(this).restartLoader(0, null, this)
|
LoaderManager.getInstance(this).restartLoader(0, null, this)
|
||||||
lifecycleScope.launch(Dispatchers.IO) {
|
lifecycleScope.launch(Dispatchers.IO) {
|
||||||
ConfigurationMessageUtilities.forceSyncConfigurationNowIfNeeded(this@MessageRequestsActivity)
|
ConfigurationMessageUtilities.forceSyncConfigurationNowIfNeeded(this@MessageRequestsActivity)
|
||||||
|
@ -18,13 +18,11 @@ import org.session.libsession.messaging.jobs.JobQueue
|
|||||||
import org.session.libsession.messaging.messages.Destination
|
import org.session.libsession.messaging.messages.Destination
|
||||||
import org.session.libsession.messaging.messages.control.ConfigurationMessage
|
import org.session.libsession.messaging.messages.control.ConfigurationMessage
|
||||||
import org.session.libsession.messaging.sending_receiving.MessageSender
|
import org.session.libsession.messaging.sending_receiving.MessageSender
|
||||||
import org.session.libsession.messaging.utilities.SessionId
|
|
||||||
import org.session.libsession.utilities.Address
|
import org.session.libsession.utilities.Address
|
||||||
import org.session.libsession.utilities.GroupUtil
|
import org.session.libsession.utilities.GroupUtil
|
||||||
import org.session.libsession.utilities.TextSecurePreferences
|
import org.session.libsession.utilities.TextSecurePreferences
|
||||||
import org.session.libsession.utilities.WindowDebouncer
|
import org.session.libsession.utilities.WindowDebouncer
|
||||||
import org.session.libsignal.utilities.Hex
|
import org.session.libsignal.utilities.Hex
|
||||||
import org.session.libsignal.utilities.Log
|
|
||||||
import org.session.libsignal.utilities.toHexString
|
import org.session.libsignal.utilities.toHexString
|
||||||
import org.thoughtcrime.securesms.dependencies.DatabaseComponent
|
import org.thoughtcrime.securesms.dependencies.DatabaseComponent
|
||||||
import java.util.Timer
|
import java.util.Timer
|
||||||
@ -199,9 +197,8 @@ object ConfigurationMessageUtilities {
|
|||||||
convoConfig.getOrConstructLegacyGroup(groupPublicKey)
|
convoConfig.getOrConstructLegacyGroup(groupPublicKey)
|
||||||
}
|
}
|
||||||
recipient.isContactRecipient -> {
|
recipient.isContactRecipient -> {
|
||||||
val sessionId = SessionId(recipient.address.serialize())
|
|
||||||
if (recipient.isLocalNumber) null // this is handled by the user profile NTS data
|
if (recipient.isLocalNumber) null // this is handled by the user profile NTS data
|
||||||
if (recipient.isOpenGroupInboxRecipient) null // specifically exclude
|
else if (recipient.isOpenGroupInboxRecipient) null // specifically exclude
|
||||||
else convoConfig.getOrConstructOneToOne(recipient.address.serialize())
|
else convoConfig.getOrConstructOneToOne(recipient.address.serialize())
|
||||||
}
|
}
|
||||||
else -> null
|
else -> null
|
||||||
|
@ -52,6 +52,7 @@
|
|||||||
android:text="Spiderman" />
|
android:text="Spiderman" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
android:id="@+id/nameEditIcon"
|
||||||
android:layout_width="20dp"
|
android:layout_width="20dp"
|
||||||
android:layout_height="22dp"
|
android:layout_height="22dp"
|
||||||
android:contentDescription="@string/AccessibilityId_edit_user_nickname"
|
android:contentDescription="@string/AccessibilityId_edit_user_nickname"
|
||||||
|
@ -5,11 +5,10 @@ import android.os.Parcel
|
|||||||
import android.os.Parcelable
|
import android.os.Parcelable
|
||||||
import android.util.Pair
|
import android.util.Pair
|
||||||
import androidx.annotation.VisibleForTesting
|
import androidx.annotation.VisibleForTesting
|
||||||
import org.session.libsession.utilities.DelimiterUtil
|
|
||||||
import org.session.libsession.utilities.GroupUtil
|
|
||||||
import org.session.libsignal.utilities.guava.Optional
|
|
||||||
import org.session.libsignal.utilities.Util
|
import org.session.libsignal.utilities.Util
|
||||||
import java.util.*
|
import org.session.libsignal.utilities.guava.Optional
|
||||||
|
import java.util.Collections
|
||||||
|
import java.util.LinkedList
|
||||||
import java.util.concurrent.atomic.AtomicReference
|
import java.util.concurrent.atomic.AtomicReference
|
||||||
import java.util.regex.Matcher
|
import java.util.regex.Matcher
|
||||||
import java.util.regex.Pattern
|
import java.util.regex.Pattern
|
||||||
|
Loading…
Reference in New Issue
Block a user