mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-05-04 15:35:38 +01:00
Show groups that have the same member list during group creation.
This commit is contained in:
committed by
Cody Henthorne
parent
f09bf5b14c
commit
9de75b3e1f
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user