Skip to content

Commit

Permalink
make all addresses lowercased
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Nov 15, 2024
1 parent 68ee376 commit 86d6ae2
Show file tree
Hide file tree
Showing 3 changed files with 725 additions and 258 deletions.
4 changes: 2 additions & 2 deletions library/src/main/java/libxmtp-version.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 257063e9
Version: 29a955a1
Branch: main
Date: 2024-10-29 02:56:38 +0000
Date: 2024-11-14 22:21:21 +0000
20 changes: 10 additions & 10 deletions library/src/main/java/org/xmtp/android/library/Client.kt
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ class Client() {
logger = XMTPLogger(),
host = options.api.env.getUrl(),
isSecure = options.api.isSecure,
accountAddress = address
accountAddress = address.lowercase()
)
if (inboxId.isNullOrBlank()) {
inboxId = generateInboxId(address, 0.toULong())
inboxId = generateInboxId(address.lowercase(), 0.toULong())
}
return inboxId
}
Expand Down Expand Up @@ -188,7 +188,7 @@ class Client() {
installationId: String = "",
inboxId: String,
) : this() {
this.address = address
this.address = address.lowercase()
this.privateKeyBundleV1 = privateKeyBundleV1
this.apiClient = apiClient
this.contacts = Contacts(client = this)
Expand All @@ -210,7 +210,7 @@ class Client() {
inboxId: String,
environment: XMTPEnvironment,
) : this() {
this.address = address
this.address = address.lowercase()
this.contacts = Contacts(client = this)
this.v3Client = libXMTPClient
this.conversations =
Expand Down Expand Up @@ -261,14 +261,14 @@ class Client() {
apiClient,
clientOptions
)
val inboxId = getOrCreateInboxId(clientOptions, account.address)
val inboxId = getOrCreateInboxId(clientOptions, account.address.lowercase())
val (libXMTPClient, dbPath) =
ffiXmtpClient(
clientOptions,
account,
clientOptions.appContext,
privateKeyBundleV1,
account.address,
account.address.lowercase(),
inboxId
)

Expand All @@ -294,14 +294,14 @@ class Client() {
clientOptions: ClientOptions,
signingKey: SigningKey? = null,
): Client {
val inboxId = getOrCreateInboxId(clientOptions, accountAddress)
val inboxId = getOrCreateInboxId(clientOptions, accountAddress.lowercase())

val (libXMTPClient, dbPath) = ffiXmtpClient(
clientOptions,
signingKey,
clientOptions.appContext,
null,
accountAddress,
accountAddress.lowercase(),
inboxId
)

Expand Down Expand Up @@ -368,14 +368,14 @@ class Client() {
)
newOptions.api.appVersion?.let { v2Client.setAppVersion(it) }
val apiClient = GRPCApiClient(environment = newOptions.api.env, rustV2Client = v2Client)
val inboxId = getOrCreateInboxId(newOptions, address)
val inboxId = getOrCreateInboxId(newOptions, address.lowercase())
val (v3Client, dbPath) = if (isV3Enabled(options)) {
ffiXmtpClient(
newOptions,
account,
options?.appContext,
v1Bundle,
address,
address.lowercase(),
inboxId
)
} else Pair(null, "")
Expand Down
Loading

0 comments on commit 86d6ae2

Please sign in to comment.