Iterate
This commit is contained in:
parent
c1cd188555
commit
7d6126409f
1 changed files with 6 additions and 1 deletions
|
|
@ -434,7 +434,8 @@ class RustMatrixAuthenticationService(
|
||||||
qrCodeData: QrCodeData,
|
qrCodeData: QrCodeData,
|
||||||
): Client {
|
): Client {
|
||||||
Timber.d("Creating client for QR Code login with simplified sliding sync")
|
Timber.d("Creating client for QR Code login with simplified sliding sync")
|
||||||
// The 2025 versions of MSC4108 should always give us the baseUrl
|
// The 2025 version of MSC4108 will always give us the baseUrl and guarantees it to be a well-formed URL
|
||||||
|
// The 2024 version always has null baseUrl and uses the serverName instead, which can be null or malformed
|
||||||
val baseUrlOrServerName = qrCodeData.baseUrl() ?: qrCodeData.serverName()
|
val baseUrlOrServerName = qrCodeData.baseUrl() ?: qrCodeData.serverName()
|
||||||
|
|
||||||
if (baseUrlOrServerName == null) {
|
if (baseUrlOrServerName == null) {
|
||||||
|
|
@ -444,6 +445,10 @@ class RustMatrixAuthenticationService(
|
||||||
throw HumanQrLoginException.OtherDeviceNotSignedIn()
|
throw HumanQrLoginException.OtherDeviceNotSignedIn()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (baseUrlOrServerName.isBlank()) {
|
||||||
|
error("The QR code contains an empty base URL or server name, which is invalid")
|
||||||
|
}
|
||||||
|
|
||||||
return rustMatrixClientFactory
|
return rustMatrixClientFactory
|
||||||
.getBaseClientBuilder(
|
.getBaseClientBuilder(
|
||||||
sessionPaths = sessionPaths,
|
sessionPaths = sessionPaths,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue