Skip to content

Commit

Permalink
Merge pull request #79 from xmtp/np/consent-syncing-forks
Browse files Browse the repository at this point in the history
Bump the pod version
  • Loading branch information
nplasterer authored Nov 15, 2024
2 parents 83bd77f + dc60741 commit f495d4f
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 10 deletions.
4 changes: 2 additions & 2 deletions LibXMTP.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'LibXMTP'
s.version = '3.0.0'
s.version = '3.0.1'
s.summary = 'XMTP shared Rust code that powers cross-platform SDKs'

s.homepage = 'https://github.com/xmtp/libxmtp-swift'
Expand All @@ -10,7 +10,7 @@ Pod::Spec.new do |s|
s.platform = :ios, '14.0', :macos, '11.0'
s.swift_version = '5.3'

s.source = { :http => "https://github.com/xmtp/libxmtp/releases/download/swift-bindings-ae7a267/LibXMTPSwiftFFI.zip", :type => :zip }
s.source = { :http => "https://github.com/xmtp/libxmtp/releases/download/swift-bindings-29a955a/LibXMTPSwiftFFI.zip", :type => :zip }
s.vendored_frameworks = 'LibXMTPSwiftFFI.xcframework'
s.source_files = 'Sources/LibXMTP/**/*'
end
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ let package = Package(
),
.binaryTarget(
name: "LibXMTPSwiftFFI",
url: "https://github.com/xmtp/libxmtp/releases/download/swift-bindings-ae7a267/LibXMTPSwiftFFI.zip",
checksum: "e5c39daae8fcb16871efd4d194e2d5fc7c5e9e87613cab412cd416cdc33977cc"
url: "https://github.com/xmtp/libxmtp/releases/download/swift-bindings-29a955a/LibXMTPSwiftFFI.zip",
checksum: "0a5f600d5f12161c461992689f24130d5217c1872f2a83e93cd18d859bf0a233"
),
.testTarget(name: "LibXMTPTests", dependencies: ["LibXMTP"]),
]
Expand Down
4 changes: 2 additions & 2 deletions Sources/LibXMTP/libxmtp-version.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: ae7a267d
Version: 29a955a1
Branch: main
Date: 2024-11-07 20:55:17 +0000
Date: 2024-11-14 22:21:21 +0000
77 changes: 73 additions & 4 deletions Sources/LibXMTP/xmtpv3.swift
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,8 @@ public protocol FfiConversationProtocol: AnyObject {

func consentState() throws -> FfiConsentState

func conversationType() throws -> FfiConversationType

func createdAtNs() -> Int64

func dmPeerInboxId() throws -> String
Expand Down Expand Up @@ -761,6 +763,12 @@ open class FfiConversation:
})
}

open func conversationType() throws -> FfiConversationType {
return try FfiConverterTypeFfiConversationType.lift(rustCallWithError(FfiConverterTypeGenericError.lift) {
uniffi_xmtpv3_fn_method_fficonversation_conversation_type(self.uniffiClonePointer(), $0)
})
}

open func createdAtNs() -> Int64 {
return try! FfiConverterInt64.lift(try! rustCall {
uniffi_xmtpv3_fn_method_fficonversation_created_at_ns(self.uniffiClonePointer(), $0)
Expand Down Expand Up @@ -1360,7 +1368,7 @@ public func FfiConverterTypeFfiConversationCallback_lower(_ value: FfiConversati
}

public protocol FfiConversationMetadataProtocol: AnyObject {
func conversationType() -> String
func conversationType() -> FfiConversationType

func creatorInboxId() -> String
}
Expand Down Expand Up @@ -1414,8 +1422,8 @@ open class FfiConversationMetadata:
try! rustCall { uniffi_xmtpv3_fn_free_fficonversationmetadata(pointer, $0) }
}

open func conversationType() -> String {
return try! FfiConverterString.lift(try! rustCall {
open func conversationType() -> FfiConversationType {
return try! FfiConverterTypeFfiConversationType.lift(try! rustCall {
uniffi_xmtpv3_fn_method_fficonversationmetadata_conversation_type(self.uniffiClonePointer(), $0)
})
}
Expand Down Expand Up @@ -5008,6 +5016,64 @@ extension FfiConversationMessageKind: Equatable, Hashable {}
// Note that we don't yet support `indirect` for enums.
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.

public enum FfiConversationType {
case group
case dm
case sync
}

#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public struct FfiConverterTypeFfiConversationType: FfiConverterRustBuffer {
typealias SwiftType = FfiConversationType

public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> FfiConversationType {
let variant: Int32 = try readInt(&buf)
switch variant {
case 1: return .group

case 2: return .dm

case 3: return .sync

default: throw UniffiInternalError.unexpectedEnumCase
}
}

public static func write(_ value: FfiConversationType, into buf: inout [UInt8]) {
switch value {
case .group:
writeInt(&buf, Int32(1))

case .dm:
writeInt(&buf, Int32(2))

case .sync:
writeInt(&buf, Int32(3))
}
}
}

#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeFfiConversationType_lift(_ buf: RustBuffer) throws -> FfiConversationType {
return try FfiConverterTypeFfiConversationType.lift(buf)
}

#if swift(>=5.8)
@_documentation(visibility: private)
#endif
public func FfiConverterTypeFfiConversationType_lower(_ value: FfiConversationType) -> RustBuffer {
return FfiConverterTypeFfiConversationType.lower(value)
}

extension FfiConversationType: Equatable, Hashable {}

// Note that we don't yet support `indirect` for enums.
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.

public enum FfiDeliveryStatus {
case unpublished
case published
Expand Down Expand Up @@ -6905,6 +6971,9 @@ private var initializationResult: InitializationResult = {
if uniffi_xmtpv3_checksum_method_fficonversation_consent_state() != 25033 {
return InitializationResult.apiChecksumMismatch
}
if uniffi_xmtpv3_checksum_method_fficonversation_conversation_type() != 16402 {
return InitializationResult.apiChecksumMismatch
}
if uniffi_xmtpv3_checksum_method_fficonversation_created_at_ns() != 17973 {
return InitializationResult.apiChecksumMismatch
}
Expand Down Expand Up @@ -7004,7 +7073,7 @@ private var initializationResult: InitializationResult = {
if uniffi_xmtpv3_checksum_method_fficonversationcallback_on_error() != 461 {
return InitializationResult.apiChecksumMismatch
}
if uniffi_xmtpv3_checksum_method_fficonversationmetadata_conversation_type() != 48024 {
if uniffi_xmtpv3_checksum_method_fficonversationmetadata_conversation_type() != 22241 {
return InitializationResult.apiChecksumMismatch
}
if uniffi_xmtpv3_checksum_method_fficonversationmetadata_creator_inbox_id() != 61067 {
Expand Down

0 comments on commit f495d4f

Please sign in to comment.