fix: make cross signing work with server names containing :

Server names are allowed to contain ':' to specify a port, see https://matrix.org/docs/spec/appendices#server-name
User ids on the other hand are not allowed to contain ':', even
historical user ids, see https://matrix.org/docs/spec/appendices#historical-user-ids

Therefore we can use the first instance of ':' to split the user
localpart from the server name.
This commit is contained in:
Timo Kösters 2021-03-15 22:25:51 +01:00
parent e8d4fab305
commit dd2a7397a4
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
2 changed files with 2 additions and 1 deletions

View file

@ -47,6 +47,7 @@ Bugfix 🐛:
- Be robust if Event.type is missing (#2946)
- Snappier message send status
- Fix MainActivity display (#2927)
- Cross signing now works with servers with an explicit port in the servername
Translations 🗣:
- All string resources and translations have been moved to the application module. Weblate project for the SDK will be removed.

View file

@ -104,7 +104,7 @@ internal class DeviceListManager @Inject constructor(private val cryptoStore: IM
if (':' in userId) {
try {
synchronized(notReadyToRetryHS) {
res = !notReadyToRetryHS.contains(userId.substringAfterLast(':'))
res = !notReadyToRetryHS.contains(userId.substringAfter(':'))
}
} catch (e: Exception) {
Timber.e(e, "## CRYPTO | canRetryKeysDownload() failed")