crypto: Rewrap and use the new isUserTracked method
This commit is contained in:
		
							parent
							
								
									ac153c80d5
								
							
						
					
					
						commit
						38644f0aa2
					
				@ -255,7 +255,11 @@ internal class DefaultCryptoService @Inject constructor(
 | 
			
		||||
     * @return the tracking status
 | 
			
		||||
     */
 | 
			
		||||
    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>) =
 | 
			
		||||
            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.
 | 
			
		||||
     *
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user