mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-12-28 03:48:37 +03:00
crypto: Rewrap and use the new isUserTracked method
This commit is contained in:
parent
ac153c80d5
commit
38644f0aa2
2 changed files with 16 additions and 1 deletions
|
@ -255,7 +255,11 @@ internal class DefaultCryptoService @Inject constructor(
|
||||||
* @return the tracking status
|
* @return the tracking status
|
||||||
*/
|
*/
|
||||||
override fun getDeviceTrackingStatus(userId: String): Int {
|
override fun getDeviceTrackingStatus(userId: String): Int {
|
||||||
return cryptoStore.getDeviceTrackingStatus(userId, DeviceListManager.TRACKING_STATUS_NOT_TRACKED)
|
return if (olmMachine.isUserTracked(userId)) {
|
||||||
|
3
|
||||||
|
} else {
|
||||||
|
-1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -332,6 +332,17 @@ internal class OlmMachine(
|
||||||
suspend fun updateTrackedUsers(users: List<String>) =
|
suspend fun updateTrackedUsers(users: List<String>) =
|
||||||
withContext(Dispatchers.IO) { inner.updateTrackedUsers(users) }
|
withContext(Dispatchers.IO) { inner.updateTrackedUsers(users) }
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the given user is considered to be tracked.
|
||||||
|
* A user can be marked for tracking using the
|
||||||
|
* [OlmMachine.updateTrackedUsers] method.
|
||||||
|
*/
|
||||||
|
@Throws(CryptoStoreException::class)
|
||||||
|
fun isUserTracked(userId: String): Boolean {
|
||||||
|
return this.inner.isUserTracked(userId)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate one-time key claiming requests for all the users we are missing sessions for.
|
* Generate one-time key claiming requests for all the users we are missing sessions for.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue