This commit is contained in:
Hugh Nimmo-Smith 2022-10-14 17:23:26 +01:00
parent dc9b41d19a
commit fdc55965ca
2 changed files with 6 additions and 2 deletions

View file

@ -19,6 +19,9 @@ package org.matrix.android.sdk.api.rendezvous
import org.matrix.android.sdk.api.rendezvous.model.ECDHRendezvousCode
import org.matrix.android.sdk.api.rendezvous.model.RendezvousIntent
/**
* Representation of a rendezvous channel such as that described by MSC3903
*/
interface RendezvousChannel {
var transport: RendezvousTransport
@ -44,7 +47,7 @@ interface RendezvousChannel {
*/
suspend fun close()
// TODO: this should be transport independent in the future
// In future we probably want this to be a more generic RendezvousCode but it is suffice for now
suspend fun generateCode(intent: RendezvousIntent): ECDHRendezvousCode
suspend fun cancel(reason: RendezvousFailureReason)
}

View file

@ -80,7 +80,8 @@ class QrCodeLoginStatusFragment : VectorBaseFragment<FragmentQrCodeLoginStatusBi
private fun getErrorCode(reason: RendezvousFailureReason): String {
return when (reason) {
RendezvousFailureReason.UnsupportedAlgorithm, RendezvousFailureReason.UnsupportedTransport -> getString(R.string.qr_code_login_header_failed_device_is_not_supported_description)
RendezvousFailureReason.UnsupportedAlgorithm,
RendezvousFailureReason.UnsupportedTransport -> getString(R.string.qr_code_login_header_failed_device_is_not_supported_description)
RendezvousFailureReason.Expired -> getString(R.string.qr_code_login_header_failed_timeout_description)
RendezvousFailureReason.UserDeclined -> getString(R.string.qr_code_login_header_failed_denied_description)
else -> getString(R.string.qr_code_login_header_failed_other_description)