Fix / cancel copy when verifying other

This commit is contained in:
Valere 2020-03-26 13:49:09 +01:00
parent 42a8c561db
commit 1de57bbf3b
2 changed files with 10 additions and 2 deletions

View file

@ -16,11 +16,13 @@
package im.vector.riotx.features.crypto.verification.cancel
import androidx.core.text.toSpannable
import com.airbnb.epoxy.EpoxyController
import im.vector.riotx.R
import im.vector.riotx.core.epoxy.dividerItem
import im.vector.riotx.core.resources.ColorProvider
import im.vector.riotx.core.resources.StringProvider
import im.vector.riotx.core.utils.colorizeMatchingText
import im.vector.riotx.features.crypto.verification.VerificationBottomSheetViewState
import im.vector.riotx.features.crypto.verification.epoxy.bottomSheetVerificationActionItem
import im.vector.riotx.features.crypto.verification.epoxy.bottomSheetVerificationNoticeItem
@ -56,9 +58,15 @@ class VerificationCancelController @Inject constructor(
}
}
} else {
val otherUserID = state.otherUserMxItem?.id ?: ""
val otherDisplayName = state.otherUserMxItem?.displayName ?: ""
bottomSheetVerificationNoticeItem {
id("notice")
notice(stringProvider.getString(R.string.verify_cancel_other))
notice(
stringProvider.getString(R.string.verify_cancel_other, otherDisplayName, otherUserID)
.toSpannable()
.colorizeMatchingText(otherUserID, colorProvider.getColorFromAttribute(R.attr.vctr_notice_text_color))
)
}
}

View file

@ -23,7 +23,7 @@
<string name="verify_cancel_self_verification_from_untrusted">If you cancel, you wont be able to read encrypted messages on this device, and other users wont trust it</string>
<string name="verify_cancel_self_verification_from_trusted">If you cancel, you wont be able to read encrypted messages on your new device, and other users wont trust it</string>
<string name="verify_cancel_other">You can verify them later from their user profile.</string>
<string name="verify_cancel_other">You wont verify %1$s (%2$s) if you cancel now. Start again in their user profile.</string>
<string name="verify_not_me_self_verification">
One of the following may be compromised:\n\n- Your password\n- Your homeserver\n- This device, or the other device\n- The internet connection either device is using\n\nWe recommend you change your password &amp; recovery key in Settings immediately.