mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Make the PUSHER_APP_ID configurable at build time.
This commit is contained in:
+2
-3
@@ -10,7 +10,6 @@ package io.element.android.libraries.push.impl
|
||||
|
||||
import dev.zacsweers.metro.AppScope
|
||||
import dev.zacsweers.metro.ContributesBinding
|
||||
import io.element.android.appconfig.PushConfig
|
||||
import io.element.android.libraries.core.extensions.mapFailure
|
||||
import io.element.android.libraries.core.log.logger.LoggerTag
|
||||
import io.element.android.libraries.core.meta.BuildMeta
|
||||
@@ -74,7 +73,7 @@ class DefaultPusherSubscriber(
|
||||
): SetHttpPusherData =
|
||||
SetHttpPusherData(
|
||||
pushKey = pushKey,
|
||||
appId = PushConfig.PUSHER_APP_ID,
|
||||
appId = BuildConfig.PUSHER_APP_ID,
|
||||
// TODO + abs(activeSessionHolder.getActiveSession().myUserId.hashCode())
|
||||
profileTag = DEFAULT_PUSHER_FILE_TAG + "_",
|
||||
// TODO localeProvider.current().language
|
||||
@@ -104,7 +103,7 @@ class DefaultPusherSubscriber(
|
||||
.unsetHttpPusher(
|
||||
unsetHttpPusherData = UnsetHttpPusherData(
|
||||
pushKey = pushKey,
|
||||
appId = PushConfig.PUSHER_APP_ID
|
||||
appId = BuildConfig.PUSHER_APP_ID
|
||||
)
|
||||
)
|
||||
.onSuccess {
|
||||
|
||||
+2
-2
@@ -10,9 +10,9 @@ package io.element.android.libraries.push.impl.test
|
||||
|
||||
import dev.zacsweers.metro.AppScope
|
||||
import dev.zacsweers.metro.ContributesBinding
|
||||
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.BuildConfig
|
||||
import io.element.android.libraries.push.impl.pushgateway.PushGatewayNotifyRequest
|
||||
import io.element.android.libraries.pushproviders.api.Config
|
||||
|
||||
@@ -28,7 +28,7 @@ class DefaultTestPush(
|
||||
pushGatewayNotifyRequest.execute(
|
||||
PushGatewayNotifyRequest.Params(
|
||||
url = config.url,
|
||||
appId = PushConfig.PUSHER_APP_ID,
|
||||
appId = BuildConfig.PUSHER_APP_ID,
|
||||
pushKey = config.pushKey,
|
||||
eventId = TEST_EVENT_ID,
|
||||
roomId = TEST_ROOM_ID,
|
||||
|
||||
+2
-3
@@ -9,7 +9,6 @@
|
||||
package io.element.android.libraries.push.impl
|
||||
|
||||
import com.google.common.truth.Truth.assertThat
|
||||
import io.element.android.appconfig.PushConfig
|
||||
import io.element.android.libraries.core.meta.BuildMeta
|
||||
import io.element.android.libraries.matrix.api.pusher.SetHttpPusherData
|
||||
import io.element.android.libraries.matrix.api.pusher.UnsetHttpPusherData
|
||||
@@ -96,7 +95,7 @@ class DefaultPusherSubscriberTest {
|
||||
value(
|
||||
SetHttpPusherData(
|
||||
pushKey = "aPushKey",
|
||||
appId = PushConfig.PUSHER_APP_ID,
|
||||
appId = BuildConfig.PUSHER_APP_ID,
|
||||
url = "aGateway",
|
||||
appDisplayName = "MyApp",
|
||||
deviceDisplayName = "MyDevice",
|
||||
@@ -163,7 +162,7 @@ class DefaultPusherSubscriberTest {
|
||||
value(
|
||||
UnsetHttpPusherData(
|
||||
pushKey = "aPushKey",
|
||||
appId = PushConfig.PUSHER_APP_ID,
|
||||
appId = BuildConfig.PUSHER_APP_ID,
|
||||
),
|
||||
)
|
||||
)
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@
|
||||
|
||||
package io.element.android.libraries.push.impl.test
|
||||
|
||||
import io.element.android.appconfig.PushConfig
|
||||
import io.element.android.libraries.push.impl.BuildConfig
|
||||
import io.element.android.libraries.push.impl.pushgateway.PushGatewayNotifyRequest
|
||||
import io.element.android.libraries.pushproviders.test.aSessionPushConfig
|
||||
import io.element.android.tests.testutils.lambda.lambdaRecorder
|
||||
@@ -33,7 +33,7 @@ class DefaultTestPushTest {
|
||||
value(
|
||||
PushGatewayNotifyRequest.Params(
|
||||
url = aConfig.url,
|
||||
appId = PushConfig.PUSHER_APP_ID,
|
||||
appId = BuildConfig.PUSHER_APP_ID,
|
||||
pushKey = aConfig.pushKey,
|
||||
eventId = DefaultTestPush.TEST_EVENT_ID,
|
||||
roomId = DefaultTestPush.TEST_ROOM_ID,
|
||||
|
||||
Reference in New Issue
Block a user