Skip to content

Commit

Permalink
add back so v2 also gets it
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Sep 13, 2024
1 parent 0a1b7a1 commit 95ecc4c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions library/src/main/java/org/xmtp/android/library/Group.kt
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ class Group(val client: Client, private val libXMTPGroup: FfiGroup) {
}

suspend fun send(encodedContent: EncodedContent): String {
if (consentState() == ConsentState.UNKNOWN) {
updateConsentState(ConsentState.ALLOWED)
if (client.contacts.consentList.groupState(groupId = id) == ConsentState.UNKNOWN) {
client.contacts.allowGroups(groupIds = listOf(id))
}
val messageId = libXMTPGroup.send(contentBytes = encodedContent.toByteArray())
return messageId.toHex()
Expand Down Expand Up @@ -100,8 +100,8 @@ class Group(val client: Client, private val libXMTPGroup: FfiGroup) {
}

suspend fun <T> prepareMessage(content: T, options: SendOptions? = null): String {
if (consentState() == ConsentState.UNKNOWN) {
updateConsentState(ConsentState.ALLOWED)
if (client.contacts.consentList.groupState(groupId = id) == ConsentState.UNKNOWN) {
client.contacts.allowGroups(groupIds = listOf(id))
}
val encodeContent = encodeContent(content = content, options = options)
return libXMTPGroup.sendOptimistic(encodeContent.toByteArray()).toHex()
Expand Down

0 comments on commit 95ecc4c

Please sign in to comment.