allowing the push endpoint querying to fail
This commit is contained in:
parent
1ed4248e13
commit
219b520dff
|
@ -45,7 +45,7 @@ class UnifiedPushMessageReceiver : MessagingReceiver() {
|
|||
scope.launch {
|
||||
withContext(module.dispatcher().io) {
|
||||
val matrixEndpoint = URL(endpoint).let { URL("${it.protocol}://${it.host}/_matrix/push/v1/notify") }
|
||||
val content = matrixEndpoint.openStream().use { String(it.readBytes()) }
|
||||
val content = runCatching { matrixEndpoint.openStream().use { String(it.readBytes()) } }.getOrNull() ?: ""
|
||||
val gatewayUrl = when {
|
||||
content.contains("\"gateway\":\"matrix\"") -> matrixEndpoint.toString()
|
||||
else -> FALLBACK_UNIFIED_PUSH_GATEWAY
|
||||
|
|
Loading…
Reference in New Issue