Skip to content

Commit ffbd2d7

Browse files
committed
add is active check to groups
1 parent 603ae5b commit ffbd2d7

File tree

2 files changed

+17
-0
lines changed
  • library/src

2 files changed

+17
-0
lines changed

library/src/androidTest/java/org/xmtp/android/library/GroupTest.kt

+13
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,19 @@ class GroupTest {
113113
)
114114
}
115115

116+
@Test
117+
fun testIsActiveReturnsCorrectly() {
118+
val group = boClient.conversations.newGroup(
119+
listOf(
120+
alix.walletAddress,
121+
caro.walletAddress
122+
)
123+
)
124+
assert(group.isActive())
125+
group.removeMembers(listOf(bo.walletAddress))
126+
assert(!group.isActive())
127+
}
128+
116129
@Test
117130
fun testCanListGroups() {
118131
boClient.conversations.newGroup(listOf(alix.walletAddress))

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

+4
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ class Group(val client: Client, private val libXMTPGroup: FfiGroup) {
128128
)
129129
}
130130

131+
fun isActive(): Boolean {
132+
return libXMTPGroup.isActive()
133+
}
134+
131135
fun addMembers(addresses: List<String>) {
132136
runBlocking { libXMTPGroup.addMembers(addresses) }
133137
}

0 commit comments

Comments
 (0)