Skip to content

Commit fc86eed

Browse files
committed
undo all the bad merge items
1 parent 9b5d62d commit fc86eed

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

example/src/main/java/org/xmtp/android/example/conversation/NewGroupBottomSheet.kt

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import androidx.lifecycle.repeatOnLifecycle
1414
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
1515
import kotlinx.coroutines.launch
1616
import org.xmtp.android.example.R
17+
import org.xmtp.android.example.databinding.BottomSheetNewConversationBinding
1718
import org.xmtp.android.example.databinding.BottomSheetNewGroupBinding
1819
import java.util.regex.Pattern
1920

library/src/main/java/org/xmtp/android/library/Conversations.kt

+12-13
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import kotlinx.coroutines.flow.MutableStateFlow
99
import kotlinx.coroutines.flow.flow
1010
import kotlinx.coroutines.launch
1111
import kotlinx.coroutines.runBlocking
12-
import org.xmtp.android.library.Conversation.*
1312
import org.xmtp.android.library.GRPCApiClient.Companion.makeQueryRequest
1413
import org.xmtp.android.library.GRPCApiClient.Companion.makeSubscribeRequest
1514
import org.xmtp.android.library.messages.DecryptedMessage
@@ -61,7 +60,7 @@ data class Conversations(
6160
fun fromInvite(envelope: Envelope): Conversation {
6261
val sealedInvitation = Invitation.SealedInvitation.parseFrom(envelope.message)
6362
val unsealed = sealedInvitation.v1.getInvitation(viewer = client.keys)
64-
return V2(
63+
return Conversation.V2(
6564
ConversationV2.create(
6665
client = client,
6766
invitation = unsealed,
@@ -81,7 +80,7 @@ data class Conversations(
8180
val senderAddress = messageV1.header.sender.walletAddress
8281
val recipientAddress = messageV1.header.recipient.walletAddress
8382
val peerAddress = if (client.address == senderAddress) recipientAddress else senderAddress
84-
return V1(
83+
return Conversation.V1(
8584
ConversationV1(
8685
client = client,
8786
peerAddress = peerAddress,
@@ -154,7 +153,7 @@ data class Conversations(
154153
val invitationPeers = listIntroductionPeers()
155154
val peerSeenAt = invitationPeers[peerAddress]
156155
if (peerSeenAt != null) {
157-
val conversation = V1(
156+
val conversation = Conversation.V1(
158157
ConversationV1(
159158
client = client,
160159
peerAddress = peerAddress,
@@ -168,7 +167,7 @@ data class Conversations(
168167

169168
// If the contact is v1, start a v1 conversation
170169
if (Contact.ContactBundle.VersionCase.V1 == contact.versionCase && context?.conversationId.isNullOrEmpty()) {
171-
val conversation = V1(
170+
val conversation = Conversation.V1(
172171
ConversationV1(
173172
client = client,
174173
peerAddress = peerAddress,
@@ -185,7 +184,7 @@ data class Conversations(
185184
}
186185
val invite = sealedInvitation.v1.getInvitation(viewer = client.keys)
187186
if (invite.context.conversationId == context?.conversationId && invite.context.conversationId != "") {
188-
val conversation = V2(
187+
val conversation = Conversation.V2(
189188
ConversationV2(
190189
topic = invite.topic,
191190
keyMaterial = invite.aes256GcmHkdfSha256.keyMaterial.toByteArray(),
@@ -211,7 +210,7 @@ data class Conversations(
211210
header = sealedInvitation.v1.header,
212211
)
213212
client.contacts.allow(addresses = listOf(peerAddress))
214-
val conversation = V2(conversationV2)
213+
val conversation = Conversation.V2(conversationV2)
215214
conversationsByTopic[conversation.topic] = conversation
216215
return conversation
217216
}
@@ -227,7 +226,7 @@ data class Conversations(
227226
val seenPeers = listIntroductionPeers(pagination = pagination)
228227
for ((peerAddress, sentAt) in seenPeers) {
229228
newConversations.add(
230-
V1(
229+
Conversation.V1(
231230
ConversationV1(
232231
client = client,
233232
peerAddress = peerAddress,
@@ -239,7 +238,7 @@ data class Conversations(
239238
val invitations = listInvitations(pagination = pagination)
240239
for (sealedInvitation in invitations) {
241240
try {
242-
newConversations.add(V2(conversation(sealedInvitation)))
241+
newConversations.add(Conversation.V2(conversation(sealedInvitation)))
243242
} catch (e: Exception) {
244243
Log.d(TAG, e.message.toString())
245244
}
@@ -254,7 +253,7 @@ data class Conversations(
254253
syncGroups()
255254
listGroups()
256255
}
257-
conversationsByTopic += groups.map { Pair(it.id.toString(), Group(it)) }
256+
conversationsByTopic += groups.map { Pair(it.id.toString(), Conversation.Group(it)) }
258257
}
259258
return conversationsByTopic.values.sortedByDescending { it.createdAt }
260259
}
@@ -263,15 +262,15 @@ data class Conversations(
263262
val conversation: Conversation
264263
if (!data.hasInvitation()) {
265264
val sentAt = Date(data.createdNs / 1_000_000)
266-
conversation = V1(
265+
conversation = Conversation.V1(
267266
ConversationV1(
268267
client,
269268
data.peerAddress,
270269
sentAt,
271270
),
272271
)
273272
} else {
274-
conversation = V2(
273+
conversation = Conversation.V2(
275274
ConversationV2(
276275
topic = data.invitation.topic,
277276
keyMaterial = data.invitation.aes256GcmHkdfSha256.keyMaterial.toByteArray(),
@@ -482,7 +481,7 @@ data class Conversations(
482481
coroutineScope {
483482
launch {
484483
groupEmitter.groups.collect { group ->
485-
emit(Group(Group(client, group)))
484+
emit(Conversation.Group(Group(client, group)))
486485
}
487486
}
488487
}
Binary file not shown.

0 commit comments

Comments
 (0)