Files
Nekosu/app/src/main/java/ru/risdeveau/pixeldragon/Common.kt
T

29 lines
694 B
Kotlin
Raw Normal View History

2025-02-21 14:44:48 +03:00
/*
2025-03-03 18:42:57 +03:00
* Created by sweetbread
2026-02-20 09:41:06 +03:00
* Copyright (c) 2026. All rights reserved.
2025-02-21 14:44:48 +03:00
*/
package ru.risdeveau.pixeldragon
2025-02-22 18:45:55 +03:00
import android.util.Log
2026-02-20 09:41:06 +03:00
import de.connect2x.trixnity.client.MatrixClient
2025-02-21 14:44:48 +03:00
import io.ktor.client.HttpClient
import io.ktor.client.plugins.cache.HttpCache
2025-02-22 18:45:55 +03:00
import io.ktor.client.plugins.logging.LogLevel
import io.ktor.client.plugins.logging.Logger
import io.ktor.client.plugins.logging.Logging
2025-02-21 14:44:48 +03:00
2026-02-20 09:41:06 +03:00
val webClient = HttpClient {
2025-02-22 18:45:55 +03:00
install(Logging) {
logger = object : Logger {
override fun log(message: String) {
Log.i("Ktor", message)
}
2025-02-21 14:44:48 +03:00
}
2025-02-22 18:45:55 +03:00
level = LogLevel.ALL
2025-02-21 14:44:48 +03:00
}
install(HttpCache)
}
2026-02-20 09:41:06 +03:00
var client: MatrixClient? = null