UnifiedPush WIP

This commit is contained in:
Benoit Marty 2023-04-11 11:19:44 +02:00 committed by Benoit Marty
parent 8f565edb0a
commit 287fca5438
33 changed files with 376 additions and 215 deletions

View file

@ -0,0 +1,22 @@
/*
* Copyright (c) 2023 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.element.android.libraries.push.providers.api
data class Distributor(
val value: String,
val name: String,
)

View file

@ -26,8 +26,23 @@ interface PushProvider {
* Allow to sort provider, from lower index to higher index
*/
val index: Int
fun getDistributorNames(): List<String>
suspend fun registerWith(matrixClient: MatrixClient, distributorName: String)
/**
* User friendly name.
*/
val name: String
fun getDistributors(): List<Distributor>
/**
* Register the pusher to the homeserver
*/
suspend fun registerWith(matrixClient: MatrixClient, distributor: Distributor, clientSecret: String)
/**
* Unregister the pusher
*/
suspend fun unregister(matrixClient: MatrixClient)
/**
* Attempt to troubleshoot the push provider

View file

@ -20,4 +20,5 @@ import io.element.android.libraries.matrix.api.MatrixClient
interface PusherSubscriber {
suspend fun registerPusher(matrixClient: MatrixClient, pushKey: String, gateway: String)
suspend fun unregisterPusher(matrixClient: MatrixClient, pushKey: String, gateway: String)
}