Commit edd7eb2 1 parent 165f2b2 commit edd7eb2 Copy full SHA for edd7eb2
File tree 2 files changed +15
-4
lines changed
androidTest/java/org/xmtp/android/library
main/java/org/xmtp/android/library
2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -232,10 +232,10 @@ class GroupTest {
232
232
boClient.conversations.streamGroups().test {
233
233
val group =
234
234
alixClient.conversations.newGroup(listOf (bo.walletAddress))
235
- assertEquals(group.id.toHex(), awaitItem().topic )
235
+ assertEquals(group.id.toHex(), awaitItem().id.toHex() )
236
236
val group2 =
237
237
caroClient.conversations.newGroup(listOf (bo.walletAddress))
238
- assertEquals(group2.id.toHex(), awaitItem().topic )
238
+ assertEquals(group2.id.toHex(), awaitItem().id.toHex() )
239
239
}
240
240
}
241
241
Original file line number Diff line number Diff line change @@ -501,10 +501,10 @@ data class Conversations(
501
501
}
502
502
503
503
fun streamAll (): Flow <Conversation > {
504
- return merge(streamGroups (), stream())
504
+ return merge(streamGroupConversations (), stream())
505
505
}
506
506
507
- fun streamGroups (): Flow <Conversation > = callbackFlow {
507
+ private fun streamGroupConversations (): Flow <Conversation > = callbackFlow {
508
508
val groupCallback = object : FfiConversationCallback {
509
509
override fun onConversation (conversation : FfiGroup ) {
510
510
trySend(Conversation .Group (Group (client, conversation)))
@@ -515,6 +515,17 @@ data class Conversations(
515
515
awaitClose { stream.end() }
516
516
}
517
517
518
+ fun streamGroups (): Flow <Group > = callbackFlow {
519
+ val groupCallback = object : FfiConversationCallback {
520
+ override fun onConversation (conversation : FfiGroup ) {
521
+ trySend(Group (client, conversation))
522
+ }
523
+ }
524
+ val stream = libXMTPConversations?.stream(groupCallback)
525
+ ? : throw XMTPException (" Client does not support Groups" )
526
+ awaitClose { stream.end() }
527
+ }
528
+
518
529
/* *
519
530
* Get the stream of all messages of the current [Client]
520
531
* @return Flow object of [DecodedMessage] that represents all the messages of the
You can’t perform that action at this time.
0 commit comments