Skip to content

Commit

Permalink
Merge pull request #1726 from Infomaniak/etag_kmail
Browse files Browse the repository at this point in the history
Add `etag` for kMail
  • Loading branch information
KevinBoulongne authored Mar 1, 2024
2 parents 71c2341 + 659bb69 commit 2878a35
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions app/src/main/java/com/infomaniak/mail/MainApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import com.infomaniak.lib.core.InfomaniakCore
import com.infomaniak.lib.core.auth.TokenInterceptorListener
import com.infomaniak.lib.core.models.user.User
import com.infomaniak.lib.core.networking.HttpClient
import com.infomaniak.lib.core.networking.HttpClientConfig
import com.infomaniak.lib.core.utils.CoilUtils
import com.infomaniak.lib.core.utils.clearStack
import com.infomaniak.lib.core.utils.hasPermissions
Expand Down Expand Up @@ -118,6 +119,8 @@ open class MainApplication : Application(), ImageLoaderFactory, DefaultLifecycle
override fun onCreate() {
super<Application>.onCreate()

HttpClientConfig.cacheDir = applicationContext.cacheDir

ProcessLifecycleOwner.get().lifecycle.addObserver(this)

if (BuildConfig.DEBUG) configureDebugMode()
Expand Down Expand Up @@ -215,10 +218,8 @@ open class MainApplication : Application(), ImageLoaderFactory, DefaultLifecycle

private fun configureHttpClient() {
AccountUtils.onRefreshTokenError = refreshTokenError
HttpClient.apply {
init(tokenInterceptorListener())
customInterceptor = listOf(UrlTraceInterceptor())
}
HttpClientConfig.customInterceptors = listOf(UrlTraceInterceptor())
HttpClient.init(tokenInterceptorListener())
}

private val refreshTokenError: (User) -> Unit = { user ->
Expand Down

0 comments on commit 2878a35

Please sign in to comment.