Skip to content

Commit

Permalink
set state to allow automatically for sending message to conversation
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Nov 1, 2023
1 parent dfe48c8 commit 1cb8318
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 @@ -107,6 +107,9 @@ data class ConversationV1(

fun send(prepared: PreparedMessage): String {
client.publish(envelopes = prepared.envelopes)
if (client.contacts.consentList.state(address = peerAddress) == ConsentState.UNKNOWN) {
client.contacts.allow(addresses = listOf(peerAddress))
}
return prepared.messageId
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ data class ConversationV2(

fun send(prepared: PreparedMessage): String {
client.publish(envelopes = prepared.envelopes)
if (client.contacts.consentList.state(address = peerAddress) == ConsentState.UNKNOWN) {
client.contacts.allow(addresses = listOf(peerAddress))
}
return prepared.messageId
}

Expand Down

0 comments on commit 1cb8318

Please sign in to comment.