Understanding things

This commit is contained in:
Benoit Marty 2020-03-06 15:57:49 +01:00
parent cb4752812a
commit a8e19f3cc9
2 changed files with 9 additions and 3 deletions

View File

@ -34,6 +34,9 @@ internal interface VerificationTransport {
onErrorReason: CancelCode,
onDone: (() -> Unit)?)
/**
* @param callback will be called with eventId and ValidVerificationInfoRequest in case of success
*/
fun sendVerificationRequest(supportedMethods: List<String>,
localId: String,
otherUserId: String,

View File

@ -198,11 +198,14 @@ internal class VerificationTransportRoomMessage(
?.let { wInfo ->
if (SendVerificationMessageWorker.hasFailed(wInfo.outputData)) {
callback(null, null)
} else if (wInfo.outputData.getString(localId) != null) {
callback(wInfo.outputData.getString(localId), validInfo)
} else {
val eventId = wInfo.outputData.getString(localId)
if (eventId != null) {
callback(eventId, validInfo)
} else {
callback(null, null)
}
}
workLiveData.removeObserver(this)
}
}