mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-01-12 01:43:49 +01:00
Small rework
This commit is contained in:
parent
9216d8ba32
commit
74de9c82c0
@ -136,11 +136,13 @@ class UnifiedPushHelper @Inject constructor(
|
||||
up.saveDistributor(context, context.packageName)
|
||||
val distributors = up.getDistributors(context).toMutableList()
|
||||
|
||||
val internalDistributorName = if (FcmHelper.isPushSupported()) {
|
||||
stringProvider.getString(R.string.unifiedpush_distributor_fcm_fallback)
|
||||
} else {
|
||||
stringProvider.getString(R.string.unifiedpush_distributor_background_sync)
|
||||
}
|
||||
val internalDistributorName = stringProvider.getString(
|
||||
if (FcmHelper.isPushSupported()) {
|
||||
R.string.unifiedpush_distributor_fcm_fallback
|
||||
} else {
|
||||
R.string.unifiedpush_distributor_background_sync
|
||||
}
|
||||
)
|
||||
|
||||
if (distributors.size == 1 &&
|
||||
!force) {
|
||||
@ -217,11 +219,9 @@ class UnifiedPushHelper @Inject constructor(
|
||||
// register app_id type upfcm on sygnal
|
||||
// the pushkey if FCM key
|
||||
if (up.getDistributor(context) == context.packageName) {
|
||||
stringProvider.getString(R.string.pusher_http_url).let {
|
||||
storePushGateway(it)
|
||||
onDoneRunnable?.run()
|
||||
return
|
||||
}
|
||||
storePushGateway(stringProvider.getString(R.string.pusher_http_url))
|
||||
onDoneRunnable?.run()
|
||||
return
|
||||
}
|
||||
// else, unifiedpush, and pushkey is an endpoint
|
||||
val gateway = stringProvider.getString(R.string.default_push_gateway_http_url)
|
||||
|
@ -31,19 +31,17 @@ class TestAvailableUnifiedPushDistributors @Inject constructor(
|
||||
|
||||
override fun perform(activityResultLauncher: ActivityResultLauncher<Intent>) {
|
||||
val distributors = unifiedPushHelper.getExternalDistributors()
|
||||
if (distributors.isEmpty()) {
|
||||
description = if (FcmHelper.isPushSupported()) {
|
||||
stringProvider.getString(R.string.settings_troubleshoot_test_distributors_gplay)
|
||||
} else {
|
||||
stringProvider.getString(R.string.settings_troubleshoot_test_distributors_fdroid)
|
||||
}
|
||||
status = TestStatus.SUCCESS
|
||||
} else {
|
||||
description = stringProvider.getString(
|
||||
R.string.settings_troubleshoot_test_distributors_many,
|
||||
distributors.size + 1
|
||||
description = if (distributors.isEmpty()) {
|
||||
stringProvider.getString(
|
||||
if (FcmHelper.isPushSupported()) {
|
||||
R.string.settings_troubleshoot_test_distributors_gplay
|
||||
} else {
|
||||
R.string.settings_troubleshoot_test_distributors_fdroid
|
||||
}
|
||||
)
|
||||
status = TestStatus.SUCCESS
|
||||
} else {
|
||||
stringProvider.getString(R.string.settings_troubleshoot_test_distributors_many, distributors.size + 1)
|
||||
}
|
||||
status = TestStatus.SUCCESS
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user