Skip to content

Commit

Permalink
add back sync consent
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Dec 20, 2024
1 parent 5397a0d commit 3378882
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class HistorySyncTest {
assertEquals(state.installations.size, 2)

runBlocking {
alixClient2.preferences.syncConsent()
alixClient.conversations.syncAllConversations()
Thread.sleep(2000)
alixClient2.conversations.syncAllConversations()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import uniffi.xmtpv3.FfiConsent
import uniffi.xmtpv3.FfiConsentCallback
import uniffi.xmtpv3.FfiConsentEntityType
import uniffi.xmtpv3.FfiConsentState
import uniffi.xmtpv3.FfiDeviceSyncKind
import uniffi.xmtpv3.FfiPreferenceCallback
import uniffi.xmtpv3.FfiPreferenceUpdate
import uniffi.xmtpv3.FfiSubscribeException
Expand Down Expand Up @@ -101,6 +102,10 @@ data class PrivatePreferences(
var client: Client,
private val ffiClient: FfiXmtpClient,
) {
suspend fun syncConsent() {
ffiClient.sendSyncRequest(FfiDeviceSyncKind.CONSENT)
}

suspend fun streamPreferenceUpdates(): Flow<PreferenceType> = callbackFlow {
val preferenceCallback = object : FfiPreferenceCallback {
override fun onPreferenceUpdate(preference: List<FfiPreferenceUpdate>) {
Expand Down

0 comments on commit 3378882

Please sign in to comment.