mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-04 10:32:34 +00:00
UnifiedPushGatewayResolver.getGateway cannot return null.
This commit is contained in:
+1
-1
@@ -26,7 +26,7 @@ class UnifiedPushGatewayResolver @Inject constructor(
|
||||
private val unifiedPushApiFactory: UnifiedPushApiFactory,
|
||||
private val coroutineDispatchers: CoroutineDispatchers,
|
||||
) {
|
||||
suspend fun getGateway(endpoint: String): String? {
|
||||
suspend fun getGateway(endpoint: String): String {
|
||||
val gateway = UnifiedPushConfig.DEFAULT_PUSH_GATEWAY_HTTP_URL
|
||||
try {
|
||||
val url = URL(endpoint)
|
||||
|
||||
-10
@@ -76,15 +76,6 @@ class VectorUnifiedPushMessagingReceiver : MessagingReceiver() {
|
||||
coroutineScope.launch {
|
||||
val gateway = unifiedPushGatewayResolver.getGateway(endpoint)
|
||||
unifiedPushStore.storePushGateway(gateway, instance)
|
||||
if (gateway == null) {
|
||||
Timber.tag(loggerTag.value).w("No gateway found for endpoint $endpoint")
|
||||
endpointRegistrationHandler.registrationDone(
|
||||
RegistrationResult(
|
||||
clientSecret = instance,
|
||||
result = Result.failure(IllegalStateException("No gateway found for endpoint $endpoint")),
|
||||
)
|
||||
)
|
||||
} else {
|
||||
val result = newGatewayHandler.handle(endpoint, gateway, instance)
|
||||
.onFailure {
|
||||
Timber.tag(loggerTag.value).e(it, "Failed to handle new gateway")
|
||||
@@ -99,7 +90,6 @@ class VectorUnifiedPushMessagingReceiver : MessagingReceiver() {
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
guardServiceStarter.stop()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user