Skip to content

Commit

Permalink
update legacy branch to fork fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Nov 15, 2024
1 parent d790be4 commit a2bad89
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ let package = Package(
.package(url: "https://github.com/1024jp/GzipSwift", from: "5.2.0"),
.package(url: "https://github.com/bufbuild/connect-swift", exact: "0.12.0"),
.package(url: "https://github.com/apple/swift-docc-plugin.git", from: "1.0.0"),
.package(url: "https://github.com/xmtp/libxmtp-swift.git", exact: "0.6.0"),
.package(url: "https://github.com/xmtp/libxmtp-swift.git", exact: "3.0.1"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
Expand Down
2 changes: 2 additions & 0 deletions Sources/XMTPiOS/ApiClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ extension GenericErrorDescribing {
let .SignatureRequestError(message),
let .Erc1271SignatureError(message),
let .FailedToConvertToU32(message),
let .Association(message),
let .DeviceSync(message),
let .Verifier(message):
return message
}
Expand Down
14 changes: 7 additions & 7 deletions Sources/XMTPiOS/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public final class Client {
inboxId: String
) async throws -> Client {
let (libxmtpClient, dbPath) = try await initV3Client(
accountAddress: accountAddress,
accountAddress: accountAddress.lowercased(),
options: options,
privateKeyBundleV1: nil,
signingKey: signingKey,
Expand All @@ -192,7 +192,7 @@ public final class Client {
}

let client = try Client(
address: accountAddress,
address: accountAddress.lowercased(),
v3Client: v3Client,
dbPath: dbPath,
installationID: v3Client.installationId().toHex,
Expand Down Expand Up @@ -307,7 +307,7 @@ public final class Client {
message: signatureRequest.signatureText())
try await signatureRequest.addScwSignature(
signatureBytes: signedData,
address: signingKey.address,
address: signingKey.address.lowercased(),
chainId: UInt64(chainId),
blockNumber: signingKey.blockNumber.flatMap {
$0 >= 0 ? UInt64($0) : nil
Expand Down Expand Up @@ -445,10 +445,10 @@ public final class Client {
logger: XMTPLogger(),
host: options.api.env.url,
isSecure: options.api.env.isSecure == true,
accountAddress: address
) ?? generateInboxId(accountAddress: address, nonce: 0)
accountAddress: address.lowercased()
) ?? generateInboxId(accountAddress: address.lowercased(), nonce: 0)
} catch {
inboxId = generateInboxId(accountAddress: address, nonce: 0)
inboxId = try generateInboxId(accountAddress: address.lowercased(), nonce: 0)
}
return inboxId
}
Expand Down Expand Up @@ -882,7 +882,7 @@ public final class Client {
guard let client = v3Client else {
throw ClientError.noV3Client("Error no V3 client initialized")
}
try await client.requestHistorySync()
try await client.sendSyncRequest(kind: .messages)
}

public func revokeAllOtherInstallations(signingKey: SigningKey) async throws
Expand Down
7 changes: 3 additions & 4 deletions Sources/XMTPiOS/Conversations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -367,15 +367,14 @@ public actor Conversations {
}
do {
let conversationType =
try conversation.groupMetadata()
.conversationType()
if conversationType == "dm" {
try conversation().conversationType()
if conversationType == .dm {
continuation.yield(
Conversation.dm(
conversation.dmFromFFI(
client: self.client))
)
} else if conversationType == "group" {
} else if conversationType == .group {
continuation.yield(
Conversation.group(
conversation.groupFromFFI(
Expand Down
2 changes: 1 addition & 1 deletion Sources/XMTPiOS/Extensions/Ffi.swift
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ extension FfiConversation {
}

func toConversation(client: Client) throws -> Conversation {
if (try groupMetadata().conversationType() == "dm") {
if (try conversationType() == .dm) {
return Conversation.dm(self.dmFromFFI(client: client))
} else {
return Conversation.group(self.groupFromFFI(client: client))
Expand Down
4 changes: 2 additions & 2 deletions 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.16.3"
spec.version = "0.16.4"
spec.summary = "XMTP SDK Cocoapod"

# This description is used to generate tags and improve search results.
Expand Down Expand Up @@ -44,5 +44,5 @@ Pod::Spec.new do |spec|
spec.dependency "web3.swift"
spec.dependency "GzipSwift"
spec.dependency "Connect-Swift", "= 0.12.0"
spec.dependency 'LibXMTP', '= 0.6.0'
spec.dependency 'LibXMTP', '= 3.0.1'
end
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/xmtp/libxmtp-swift.git",
"state" : {
"revision" : "91653cdaf999119f99189178867e32dcc53b11e8",
"version" : "0.6.0"
"revision" : "f495d4feaab40a0a6a48c1d5a99585de8107f5d2",
"version" : "3.0.1"
}
},
{
Expand Down

0 comments on commit a2bad89

Please sign in to comment.