crypto: Clean up the SAS verification transaction a bit

This commit is contained in:
Damir Jelić 2021-06-28 10:16:31 +02:00
parent d21137d910
commit 02b8b1f5b1
1 changed files with 9 additions and 25 deletions

View File

@ -43,7 +43,6 @@ internal class SasVerification(
) : ) :
SasVerificationTransaction { SasVerificationTransaction {
private val uiHandler = Handler(Looper.getMainLooper()) private val uiHandler = Handler(Looper.getMainLooper())
private var stateField: VerificationTxState = VerificationTxState.OnStarted
private fun dispatchTxUpdated() { private fun dispatchTxUpdated() {
uiHandler.post { uiHandler.post {
@ -69,24 +68,14 @@ internal class SasVerification(
} }
override val isIncoming: Boolean override val isIncoming: Boolean
get() { get() = !this.inner.weStarted
return !this.inner.weStarted
}
override var otherDeviceId: String? override var otherDeviceId: String?
get() { get() = this.inner.otherDeviceId
return this.inner.otherDeviceId @Suppress("UNUSED_PARAMETER")
} set(value) {}
set(value) {
if (value != null) {
this.inner.otherDeviceId = value
}
}
override val otherUserId: String override val otherUserId: String = this.inner.otherUserId
get() {
return this.inner.otherUserId
}
override var state: VerificationTxState override var state: VerificationTxState
get() { get() {
@ -105,14 +94,11 @@ internal class SasVerification(
} }
} }
} }
set(v) { @Suppress("UNUSED_PARAMETER")
this.stateField = v set(v) {}
}
override val transactionId: String override val transactionId: String
get() { get() = this.inner.flowId
return this.inner.flowId
}
override fun cancel() { override fun cancel() {
this.cancelHelper(CancelCode.User) this.cancelHelper(CancelCode.User)
@ -126,9 +112,7 @@ internal class SasVerification(
this.cancelHelper(CancelCode.MismatchedSas) this.cancelHelper(CancelCode.MismatchedSas)
} }
override fun isToDeviceTransport(): Boolean { override fun isToDeviceTransport(): Boolean = this.inner.roomId == null
return this.inner.roomId == null
}
override fun supportsDecimal(): Boolean { override fun supportsDecimal(): Boolean {
// This is ignored anyways, throw it away? // This is ignored anyways, throw it away?