Skip to content

Commit

Permalink
fix up the library linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Jan 30, 2024
1 parent dec2192 commit 06e4df0
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ package org.xmtp.android.library

import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import kotlinx.coroutines.runBlocking
import org.junit.Assert.*
import org.junit.Assert.assertEquals
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
Expand Down Expand Up @@ -94,4 +93,4 @@ class GroupMembershipChangeTest {
)
assert(content?.membersAddedList.isNullOrEmpty())
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import app.cash.turbine.test
import kotlinx.coroutines.ExperimentalCoroutinesApi
import org.junit.Assert.*
import org.junit.Assert.assertEquals
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
Expand Down Expand Up @@ -201,4 +201,4 @@ class GroupTest {
awaitComplete()
}
}
}
}
2 changes: 1 addition & 1 deletion library/src/main/java/org/xmtp/android/library/Client.kt
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class Client() {
apiClient: ApiClient,
libXMTPClient: FfiXmtpClient? = null,
) : this() {
this.address = libXMTPClient?.accountAddress() ?: address
this.address = address
this.privateKeyBundleV1 = privateKeyBundleV1
this.apiClient = apiClient
this.contacts = Contacts(client = this)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@ package org.xmtp.android.library
import android.util.Log
import com.google.protobuf.kotlin.toByteString
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flowOf
import org.xmtp.android.library.codecs.EncodedContent
import org.xmtp.android.library.libxmtp.Message
import org.xmtp.android.library.messages.DecryptedMessage
import org.xmtp.android.library.messages.Envelope
import org.xmtp.android.library.messages.PagingInfoSortDirection
import org.xmtp.proto.keystore.api.v1.Keystore.TopicMap.TopicData
import org.xmtp.proto.message.api.v1.MessageApiOuterClass
import org.xmtp.proto.message.contents.Invitation
import org.xmtp.proto.message.contents.Invitation.InvitationV1.Aes256gcmHkdfsha256
import org.xmtp.android.library.messages.DecryptedMessage
import java.util.Date

/**
Expand Down Expand Up @@ -69,7 +68,6 @@ sealed class Conversation {
}
}


// This distinctly identifies between two addresses.
// Note: this will be empty for older v1 conversations.
val conversationId: String?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import org.xmtp.android.library.GRPCApiClient.Companion.makeQueryRequest
import org.xmtp.android.library.GRPCApiClient.Companion.makeSubscribeRequest
import org.xmtp.android.library.libxmtp.Message
import org.xmtp.android.library.libxmtp.MessageEmitter
import org.xmtp.android.library.messages.DecryptedMessage
import org.xmtp.android.library.messages.Envelope
import org.xmtp.android.library.messages.EnvelopeBuilder
import org.xmtp.android.library.messages.InvitationV1
Expand All @@ -35,7 +34,6 @@ import org.xmtp.android.library.messages.walletAddress
import org.xmtp.proto.keystore.api.v1.Keystore.TopicMap.TopicData
import org.xmtp.proto.message.contents.Contact
import org.xmtp.proto.message.contents.Invitation
import org.xmtp.android.library.messages.DecryptedMessage
import uniffi.xmtpv3.FfiConversations
import uniffi.xmtpv3.FfiListConversationsOptions
import uniffi.xmtpv3.org.xmtp.android.library.libxmtp.GroupEmitter
Expand Down
9 changes: 1 addition & 8 deletions library/src/main/java/org/xmtp/android/library/Group.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.xmtp.android.library

import android.util.Log
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flow
Expand All @@ -12,16 +11,10 @@ import org.xmtp.android.library.codecs.compress
import org.xmtp.android.library.libxmtp.Message
import org.xmtp.android.library.libxmtp.MessageEmitter
import org.xmtp.android.library.messages.DecryptedMessage
import org.xmtp.android.library.messages.EnvelopeBuilder
import org.xmtp.android.library.messages.MessageBuilder
import org.xmtp.android.library.messages.MessageV2Builder
import org.xmtp.android.library.messages.Pagination
import org.xmtp.android.library.messages.PagingInfoSortDirection
import org.xmtp.proto.message.api.v1.MessageApiOuterClass
import uniffi.xmtpv3.FfiGroup
import uniffi.xmtpv3.FfiListMessagesOptions
import uniffi.xmtpv3.FfiMessage
import java.security.SecureRandom
import java.util.Date
import kotlin.time.Duration.Companion.nanoseconds
import kotlin.time.DurationUnit
Expand Down Expand Up @@ -178,4 +171,4 @@ class Group(val client: Client, private val libXMTPGroup: FfiGroup) {
libXMTPGroup.listMembers().map { it.accountAddress }
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package uniffi.xmtpv3.org.xmtp.android.library.codecs

import com.google.gson.GsonBuilder
import org.xmtp.android.library.codecs.ContentCodec
import org.xmtp.android.library.codecs.ContentTypeId
import org.xmtp.android.library.codecs.ContentTypeIdBuilder
Expand Down Expand Up @@ -32,4 +31,4 @@ data class GroupMembershipChangeCodec(override var contentType: ContentTypeId =
override fun fallback(content: GroupMembershipChanges): String? {
return null
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ class GroupEmitter {
_groups.tryEmit(conversation)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ data class Message(val client: Client, private val libXMTPMessage: FfiMessage) {
throw XMTPException("Error decoding message", e)
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.xmtp.android.library.libxmtp

import android.util.Log
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.asSharedFlow
import uniffi.xmtpv3.FfiMessage
Expand All @@ -15,4 +14,4 @@ class MessageEmitter {
_messages.tryEmit(message)
}
}
}
}

0 comments on commit 06e4df0

Please sign in to comment.