Fix moar ktlint issues

This commit is contained in:
Benoit Marty 2024-01-11 09:41:14 +01:00 committed by Benoit Marty
parent a831f05f6e
commit 5d086ad82d
528 changed files with 146 additions and 629 deletions

View file

@ -21,8 +21,8 @@ object FirebaseConfig {
* It is the push gateway for firebase.
* Note: pusher_http_url should have path '/_matrix/push/v1/notify' -->
*/
const val pusher_http_url: String = "https://matrix.org/_matrix/push/v1/notify"
const val PUSHER_HTTP_URL: String = "https://matrix.org/_matrix/push/v1/notify"
const val index = 0
const val name = "Firebase"
const val INDEX = 0
const val NAME = "Firebase"
}

View file

@ -45,9 +45,9 @@ class FirebaseNewTokenHandler @Inject constructor(
.map { SessionId(it) }
.forEach { userId ->
val userDataStore = userPushStoreFactory.create(userId)
if (userDataStore.getPushProviderName() == FirebaseConfig.name) {
if (userDataStore.getPushProviderName() == FirebaseConfig.NAME) {
matrixAuthenticationService.restoreSession(userId).getOrNull()?.use { client ->
pusherSubscriber.registerPusher(client, firebaseToken, FirebaseConfig.pusher_http_url)
pusherSubscriber.registerPusher(client, firebaseToken, FirebaseConfig.PUSHER_HTTP_URL)
}
} else {
Timber.tag(loggerTag.value).d("This session is not using Firebase pusher")

View file

@ -34,8 +34,8 @@ class FirebasePushProvider @Inject constructor(
private val firebaseTroubleshooter: FirebaseTroubleshooter,
private val pusherSubscriber: PusherSubscriber,
) : PushProvider {
override val index = FirebaseConfig.index
override val name = FirebaseConfig.name
override val index = FirebaseConfig.INDEX
override val name = FirebaseConfig.NAME
override fun getDistributors(): List<Distributor> {
return listOf(Distributor("Firebase", "Firebase"))
@ -45,14 +45,14 @@ class FirebasePushProvider @Inject constructor(
val pushKey = firebaseStore.getFcmToken() ?: return Unit.also {
Timber.tag(loggerTag.value).w("Unable to register pusher, Firebase token is not known.")
}
pusherSubscriber.registerPusher(matrixClient, pushKey, FirebaseConfig.pusher_http_url)
pusherSubscriber.registerPusher(matrixClient, pushKey, FirebaseConfig.PUSHER_HTTP_URL)
}
override suspend fun unregister(matrixClient: MatrixClient) {
val pushKey = firebaseStore.getFcmToken() ?: return Unit.also {
Timber.tag(loggerTag.value).w("Unable to unregister pusher, Firebase token is not known.")
}
pusherSubscriber.unregisterPusher(matrixClient, pushKey, FirebaseConfig.pusher_http_url)
pusherSubscriber.unregisterPusher(matrixClient, pushKey, FirebaseConfig.PUSHER_HTTP_URL)
}
override suspend fun troubleshoot(): Result<Unit> {