Skip to content

Commit

Permalink
set v2 as well
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Sep 16, 2024
1 parent 1cc4f54 commit 3b43621
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion library/src/main/java/org/xmtp/android/library/Group.kt
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,15 @@ class Group(val client: Client, private val libXMTPGroup: FfiGroup) {
return MessageV3(client, message)
}

fun updateConsentState(state: ConsentState) {
suspend fun updateConsentState(state: ConsentState) {
if (client.hasV2Client) {
when (state) {
ConsentState.ALLOWED -> client.contacts.allowGroups(groupIds = listOf(id))
ConsentState.DENIED -> client.contacts.denyGroups(groupIds = listOf(id))
ConsentState.UNKNOWN -> Unit
}
}

val consentState = ConsentState.toFfiConsentState(state)
libXMTPGroup.updateConsentState(consentState)
}
Expand Down

0 comments on commit 3b43621

Please sign in to comment.