diff --git a/app/build.gradle b/app/build.gradle index 1d72dfb0fd..32b75caf37 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -13,8 +13,8 @@ configurations.forEach { it.exclude module: "commons-logging" } -def canonicalVersionCode = 382 -def canonicalVersionName = "1.20.0" +def canonicalVersionCode = 383 +def canonicalVersionName = "1.20.1" def postFixSize = 10 def abiPostFix = ['armeabi-v7a' : 1, diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt index a1eca65eb4..7b05e18594 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt @@ -813,7 +813,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe if (shouldShowLegacy) { val txt = Phrase.from(applicationContext, R.string.disappearingMessagesLegacy) - .put(NAME_KEY, legacyRecipient!!.name) + .put(NAME_KEY, legacyRecipient!!.toShortString()) .format() binding?.outdatedBannerTextView?.text = txt } @@ -1191,14 +1191,14 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe title(R.string.block) text( Phrase.from(context, R.string.blockDescription) - .put(NAME_KEY, recipient.name) + .put(NAME_KEY, recipient.toShortString()) .format() ) dangerButton(R.string.block, R.string.AccessibilityId_blockConfirm) { viewModel.block() // Block confirmation toast added as per SS-64 - val txt = Phrase.from(context, R.string.blockBlockedUser).put(NAME_KEY, recipient.name).format().toString() + val txt = Phrase.from(context, R.string.blockBlockedUser).put(NAME_KEY, recipient.toShortString()).format().toString() Toast.makeText(context, txt, Toast.LENGTH_LONG).show() if (deleteThread) { @@ -1249,7 +1249,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe title(R.string.blockUnblock) text( Phrase.from(context, R.string.blockUnblockName) - .put(NAME_KEY, recipient.name) + .put(NAME_KEY, recipient.toShortString()) .format() ) dangerButton(R.string.blockUnblock, R.string.AccessibilityId_unblockConfirm) { viewModel.unblock() } diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/dialogs/DownloadDialog.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/dialogs/DownloadDialog.kt index d3e1de9912..a1127865e9 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/dialogs/DownloadDialog.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/dialogs/DownloadDialog.kt @@ -35,7 +35,7 @@ class DownloadDialog(private val recipient: Recipient) : DialogFragment() { title(getString(R.string.attachmentsAutoDownloadModalTitle)) val explanation = Phrase.from(context, R.string.attachmentsAutoDownloadModalDescription) - .put(CONVERSATION_NAME_KEY, recipient.name) + .put(CONVERSATION_NAME_KEY, recipient.displayName) .format() val spannable = SpannableStringBuilder(explanation) diff --git a/app/src/main/java/org/thoughtcrime/securesms/home/HomeActivity.kt b/app/src/main/java/org/thoughtcrime/securesms/home/HomeActivity.kt index aeaa7338f2..2bb3d63cc0 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/home/HomeActivity.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/home/HomeActivity.kt @@ -71,6 +71,7 @@ import org.thoughtcrime.securesms.home.search.GlobalSearchViewModel import org.thoughtcrime.securesms.messagerequests.MessageRequestsActivity import com.bumptech.glide.Glide import com.bumptech.glide.RequestManager +import org.session.libsession.utilities.truncateIdForDisplay import org.thoughtcrime.securesms.notifications.PushRegistry import org.thoughtcrime.securesms.permissions.Permissions import org.thoughtcrime.securesms.preferences.SettingsActivity @@ -507,7 +508,7 @@ class HomeActivity : PassphraseRequiredActionBarActivity(), showSessionDialog { title(R.string.block) text(Phrase.from(context, R.string.blockDescription) - .put(NAME_KEY, thread.recipient.name) + .put(NAME_KEY, thread.recipient.toShortString()) .format()) dangerButton(R.string.block, R.string.AccessibilityId_blockConfirm) { lifecycleScope.launch(Dispatchers.IO) { @@ -518,7 +519,7 @@ class HomeActivity : PassphraseRequiredActionBarActivity(), } } // Block confirmation toast added as per SS-64 - val txt = Phrase.from(context, R.string.blockBlockedUser).put(NAME_KEY, thread.recipient.name).format().toString() + val txt = Phrase.from(context, R.string.blockBlockedUser).put(NAME_KEY, thread.recipient.toShortString()).format().toString() Toast.makeText(context, txt, Toast.LENGTH_LONG).show() } cancelButton() @@ -528,7 +529,7 @@ class HomeActivity : PassphraseRequiredActionBarActivity(), private fun unblockConversation(thread: ThreadRecord) { showSessionDialog { title(R.string.blockUnblock) - text(Phrase.from(context, R.string.blockUnblockName).put(NAME_KEY, thread.recipient.name).format()) + text(Phrase.from(context, R.string.blockUnblockName).put(NAME_KEY, thread.recipient.toShortString()).format()) dangerButton(R.string.blockUnblock, R.string.AccessibilityId_unblockConfirm) { lifecycleScope.launch(Dispatchers.IO) { storage.setBlocked(listOf(thread.recipient), false) @@ -616,7 +617,7 @@ class HomeActivity : PassphraseRequiredActionBarActivity(), if (recipient.name != null) { title = getString(R.string.conversationsDelete) message = Phrase.from(this.applicationContext, R.string.conversationsDeleteDescription) - .put(NAME_KEY, recipient.name) + .put(NAME_KEY, recipient.toShortString()) .format() } else { diff --git a/app/src/main/java/org/thoughtcrime/securesms/messagerequests/MessageRequestsActivity.kt b/app/src/main/java/org/thoughtcrime/securesms/messagerequests/MessageRequestsActivity.kt index 4d280a47ad..e27345afc7 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/messagerequests/MessageRequestsActivity.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/messagerequests/MessageRequestsActivity.kt @@ -87,7 +87,7 @@ class MessageRequestsActivity : PassphraseRequiredActionBarActivity(), Conversat showSessionDialog { title(R.string.block) text(Phrase.from(context, R.string.blockDescription) - .put(NAME_KEY, thread.recipient.name) + .put(NAME_KEY, thread.recipient.toShortString()) .format()) dangerButton(R.string.block, R.string.AccessibilityId_blockConfirm) { doBlock() diff --git a/libsession/src/main/java/org/session/libsession/utilities/recipients/Recipient.java b/libsession/src/main/java/org/session/libsession/utilities/recipients/Recipient.java index ac0c9067c4..8499ddf398 100644 --- a/libsession/src/main/java/org/session/libsession/utilities/recipients/Recipient.java +++ b/libsession/src/main/java/org/session/libsession/utilities/recipients/Recipient.java @@ -17,6 +17,8 @@ */ package org.session.libsession.utilities.recipients; +import static org.session.libsession.utilities.IdUtilKt.truncateIdForDisplay; + import android.content.Context; import android.graphics.drawable.Drawable; import android.net.Uri;