Skip to content

Commit

Permalink
Custom Content Codecs when preparing messages (#212)
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

* bump pod and fix spacing

---------

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 6f4a930 commit 31b5ecf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions Sources/XMTP/Conversation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,15 @@ public enum Conversation: Sendable {
return try await conversationV2.encode(codec: codec, content: content)
}
}

public func prepareMessage(encodedContent: EncodedContent, options: SendOptions? = nil) async throws -> PreparedMessage {
switch self {
case let .v1(conversationV1):
return try await conversationV1.prepareMessage(encodedContent: encodedContent, options: options)
case let .v2(conversationV2):
return try await conversationV2.prepareMessage(encodedContent: encodedContent, options: options)
}
}

public func prepareMessage<T>(content: T, options: SendOptions? = nil) async throws -> PreparedMessage {
switch self {
Expand Down
2 changes: 1 addition & 1 deletion XMTP.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |spec|
#

spec.name = "XMTP"
spec.version = "0.7.3-alpha0"
spec.version = "0.7.4-alpha0"
spec.summary = "XMTP SDK Cocoapod"

# This description is used to generate tags and improve search results.
Expand Down

0 comments on commit 31b5ecf

Please sign in to comment.