mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-22 16:07:30 +00:00
Improve param naming for isPushEnabled
This commit is contained in:
parent
296c5d743f
commit
7861eb25c2
@ -28,12 +28,12 @@ object PushRegistryV1 {
|
|||||||
|
|
||||||
fun register(
|
fun register(
|
||||||
device: Device,
|
device: Device,
|
||||||
isUsingFCM: Boolean = TextSecurePreferences.isPushEnabled(context),
|
isPushEnabled: Boolean = TextSecurePreferences.isPushEnabled(context),
|
||||||
token: String? = TextSecurePreferences.getPushToken(context),
|
token: String? = TextSecurePreferences.getPushToken(context),
|
||||||
publicKey: String? = TextSecurePreferences.getLocalNumber(context),
|
publicKey: String? = TextSecurePreferences.getLocalNumber(context),
|
||||||
legacyGroupPublicKeys: Collection<String> = MessagingModuleConfiguration.shared.storage.getAllClosedGroupPublicKeys()
|
legacyGroupPublicKeys: Collection<String> = MessagingModuleConfiguration.shared.storage.getAllClosedGroupPublicKeys()
|
||||||
): Promise<*, Exception> = when {
|
): Promise<*, Exception> = when {
|
||||||
isUsingFCM -> retryIfNeeded(maxRetryCount) {
|
isPushEnabled -> retryIfNeeded(maxRetryCount) {
|
||||||
Log.d(TAG, "register() called")
|
Log.d(TAG, "register() called")
|
||||||
doRegister(token, publicKey, device, legacyGroupPublicKeys)
|
doRegister(token, publicKey, device, legacyGroupPublicKeys)
|
||||||
} fail { exception ->
|
} fail { exception ->
|
||||||
@ -99,17 +99,17 @@ object PushRegistryV1 {
|
|||||||
|
|
||||||
fun subscribeGroup(
|
fun subscribeGroup(
|
||||||
closedGroupPublicKey: String,
|
closedGroupPublicKey: String,
|
||||||
isUsingFCM: Boolean = TextSecurePreferences.isPushEnabled(context),
|
isPushEnabled: Boolean = TextSecurePreferences.isPushEnabled(context),
|
||||||
publicKey: String = MessagingModuleConfiguration.shared.storage.getUserPublicKey()!!
|
publicKey: String = MessagingModuleConfiguration.shared.storage.getUserPublicKey()!!
|
||||||
) = if (isUsingFCM) {
|
) = if (isPushEnabled) {
|
||||||
performGroupOperation("subscribe_closed_group", closedGroupPublicKey, publicKey)
|
performGroupOperation("subscribe_closed_group", closedGroupPublicKey, publicKey)
|
||||||
} else emptyPromise()
|
} else emptyPromise()
|
||||||
|
|
||||||
fun unsubscribeGroup(
|
fun unsubscribeGroup(
|
||||||
closedGroupPublicKey: String,
|
closedGroupPublicKey: String,
|
||||||
isUsingFCM: Boolean = TextSecurePreferences.isPushEnabled(context),
|
isPushEnabled: Boolean = TextSecurePreferences.isPushEnabled(context),
|
||||||
publicKey: String = MessagingModuleConfiguration.shared.storage.getUserPublicKey()!!
|
publicKey: String = MessagingModuleConfiguration.shared.storage.getUserPublicKey()!!
|
||||||
) = if (isUsingFCM) {
|
) = if (isPushEnabled) {
|
||||||
performGroupOperation("unsubscribe_closed_group", closedGroupPublicKey, publicKey)
|
performGroupOperation("unsubscribe_closed_group", closedGroupPublicKey, publicKey)
|
||||||
} else emptyPromise()
|
} else emptyPromise()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user