Store the first provider even if no distributor is available, else error in troubleshoot test will not be accurate.

Also when registering for the first time, pick the fist available provider with at least one distributor.
This commit is contained in:
Benoit Marty 2024-06-17 17:36:39 +02:00
parent f72fc36de8
commit b4b407a69e
4 changed files with 33 additions and 2 deletions

View file

@ -44,6 +44,15 @@ interface PushService {
distributor: Distributor,
): Result<Unit>
/**
* Store the given push provider as the current one, but do not register.
* To be used when there is no distributor available.
*/
suspend fun selectPushProvider(
matrixClient: MatrixClient,
pushProvider: PushProvider,
)
fun ignoreRegistrationError(sessionId: SessionId): Flow<Boolean>
suspend fun setIgnoreRegistrationError(sessionId: SessionId, ignore: Boolean)