Fix moar ktlint issues

This commit is contained in:
Benoit Marty 2024-01-11 09:41:14 +01:00 committed by Benoit Marty
parent 5d086ad82d
commit d01c70a4fd
27 changed files with 69 additions and 53 deletions

View file

@ -21,8 +21,8 @@ object UnifiedPushConfig {
* It is the push gateway for UnifiedPush.
* Note: default_push_gateway_http_url should have path '/_matrix/push/v1/notify'
*/
const val default_push_gateway_http_url: String = "https://matrix.gateway.unifiedpush.org/_matrix/push/v1/notify"
const val DEFAULT_PUSH_GATEWAY_HTTP_URL: String = "https://matrix.gateway.unifiedpush.org/_matrix/push/v1/notify"
const val index = 1
const val name = "UnifiedPush"
const val INDEX = 1
const val NAME = "UnifiedPush"
}

View file

@ -29,7 +29,7 @@ class UnifiedPushGatewayResolver @Inject constructor(
private val coroutineDispatchers: CoroutineDispatchers,
) {
suspend fun getGateway(endpoint: String): String? {
val gateway = UnifiedPushConfig.default_push_gateway_http_url
val gateway = UnifiedPushConfig.DEFAULT_PUSH_GATEWAY_HTTP_URL
val url = URL(endpoint)
val port = if (url.port != -1) ":${url.port}" else ""
val customBase = "${url.protocol}://${url.host}$port"

View file

@ -41,7 +41,7 @@ class UnifiedPushNewGatewayHandler @Inject constructor(
Timber.w("Unable to retrieve session")
}
val userDataStore = userPushStoreFactory.create(userId)
if (userDataStore.getPushProviderName() == UnifiedPushConfig.name) {
if (userDataStore.getPushProviderName() == UnifiedPushConfig.NAME) {
matrixAuthenticationService.restoreSession(userId).getOrNull()?.use { client ->
pusherSubscriber.registerPusher(client, endpoint, pushGateway)
}

View file

@ -35,8 +35,8 @@ class UnifiedPushProvider @Inject constructor(
private val unRegisterUnifiedPushUseCase: UnregisterUnifiedPushUseCase,
private val pushClientSecret: PushClientSecret,
) : PushProvider {
override val index = UnifiedPushConfig.index
override val name = UnifiedPushConfig.name
override val index = UnifiedPushConfig.INDEX
override val name = UnifiedPushConfig.NAME
override fun getDistributors(): List<Distributor> {
val distributors = UnifiedPush.getDistributors(context)