Skip to content

Commit

Permalink
Custom Content Codecs when preparing messages (#150)
Browse files Browse the repository at this point in the history
* Custom Content Codecs when preparing messages

Adds support for prepareMessage to handled encoded content

* run formatting

---------

Co-authored-by: Alex Risch <[email protected]>
Co-authored-by: Naomi Plasterer <[email protected]>
  • Loading branch information
3 people authored Jan 3, 2024
1 parent 1eb7b1f commit d43f9d4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions library/src/main/java/org/xmtp/android/library/Conversation.kt
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,21 @@ sealed class Conversation {
}
}

fun prepareMessage(
encodedContent: EncodedContent,
options: SendOptions? = null,
): PreparedMessage {
return when (this) {
is V1 -> {
conversationV1.prepareMessage(encodedContent = encodedContent, options = options)
}

is V2 -> {
conversationV2.prepareMessage(encodedContent = encodedContent, options = options)
}
}
}

fun send(prepared: PreparedMessage): String {
return when (this) {
is V1 -> conversationV1.send(prepared = prepared)
Expand Down

0 comments on commit d43f9d4

Please sign in to comment.