Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register to distributor with VAPID #394

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ package im.molly.unifiedpush

import android.content.Context
import org.thoughtcrime.securesms.dependencies.AppDependencies
import org.thoughtcrime.securesms.keyvalue.SignalStore
import org.unifiedpush.android.connector.UnifiedPush
import org.unifiedpush.android.connector.ui.SelectDistributorDialogsBuilder
import org.unifiedpush.android.connector.ui.UnifiedPushFunctions

object UnifiedPushDistributor {


@JvmStatic
fun registerApp() {
UnifiedPush.registerApp(AppDependencies.application)
UnifiedPush.registerApp(AppDependencies.application, vapid = SignalStore.unifiedpush.mollySocketVapid)
}

@JvmStatic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,6 @@ class UnifiedPushSettingsViewModel(private val application: Application) : ViewM
refreshAndUpdateRegistration(pingOnRegister = true)
}

fun setMollySocketVapid(vapid: String) {
SignalStore.unifiedpush.mollySocketVapid = vapid
}

class Factory(private val application: Application) : ViewModelProvider.Factory {
override fun <T : ViewModel> create(modelClass: Class<T>): T {
return requireNotNull(modelClass.cast(UnifiedPushSettingsViewModel(application)))
Expand Down