Remove dependency on AppNavigationStateService from DefaultUnifiedPushCurrentUserPushConfigProvider
This commit is contained in:
parent
705b1b08f2
commit
afdfe28ef4
21 changed files with 124 additions and 160 deletions
|
|
@ -99,7 +99,7 @@ class DefaultPushService(
|
|||
|
||||
override suspend fun testPush(sessionId: SessionId): Boolean {
|
||||
val pushProvider = getCurrentPushProvider(sessionId) ?: return false
|
||||
val config = pushProvider.getCurrentUserPushConfig() ?: return false
|
||||
val config = pushProvider.getPushConfig(sessionId) ?: return false
|
||||
testPush.execute(config)
|
||||
return true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,17 +13,17 @@ import io.element.android.appconfig.PushConfig
|
|||
import io.element.android.libraries.matrix.api.core.EventId
|
||||
import io.element.android.libraries.matrix.api.core.RoomId
|
||||
import io.element.android.libraries.push.impl.pushgateway.PushGatewayNotifyRequest
|
||||
import io.element.android.libraries.pushproviders.api.CurrentUserPushConfig
|
||||
import io.element.android.libraries.pushproviders.api.Config
|
||||
|
||||
interface TestPush {
|
||||
suspend fun execute(config: CurrentUserPushConfig)
|
||||
suspend fun execute(config: Config)
|
||||
}
|
||||
|
||||
@ContributesBinding(AppScope::class)
|
||||
class DefaultTestPush(
|
||||
private val pushGatewayNotifyRequest: PushGatewayNotifyRequest,
|
||||
) : TestPush {
|
||||
override suspend fun execute(config: CurrentUserPushConfig) {
|
||||
override suspend fun execute(config: Config) {
|
||||
pushGatewayNotifyRequest.execute(
|
||||
PushGatewayNotifyRequest.Params(
|
||||
url = config.url,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue