Show groups that have the same member list during group creation.

This commit is contained in:
Greyson Parrelli
2026-03-18 22:54:29 -04:00
committed by Cody Henthorne
parent f09bf5b14c
commit 9de75b3e1f
11 changed files with 140 additions and 4 deletions
@@ -506,6 +506,17 @@ class GroupTable(context: Context?, databaseHelper: SignalDatabase?) :
}
}
@WorkerThread
fun getGroupsWithExactMembers(memberIds: Set<RecipientId>): List<GroupRecord> {
if (memberIds.isEmpty()) return emptyList()
val selfId = Recipient.self().id
val expectedMembers = if (selfId in memberIds) memberIds else memberIds + selfId
return getGroupsContainingMember(selfId, pushOnly = true, includeInactive = false)
.filter { it.members.toSet() == expectedMembers }
}
fun getGroups(): Reader {
val cursor = readableDatabase.query(joinedGroupSelect())
return Reader(cursor)