mirror of https://github.com/oxen-io/session-ios
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
901 B
Swift
24 lines
901 B
Swift
5 years ago
|
|
||
|
public enum GroupUtilities {
|
||
|
|
||
|
public static func getClosedGroupMembers(_ closedGroup: TSGroupThread) -> [String] {
|
||
|
var result: [String]!
|
||
|
OWSPrimaryStorage.shared().dbReadConnection.read { transaction in
|
||
|
result = getClosedGroupMembers(closedGroup, with: transaction)
|
||
|
}
|
||
|
return result
|
||
|
}
|
||
|
|
||
|
public static func getClosedGroupMembers(_ closedGroup: TSGroupThread, with transaction: YapDatabaseReadTransaction) -> [String] {
|
||
5 years ago
|
return closedGroup.groupModel.groupMemberIds
|
||
5 years ago
|
}
|
||
|
|
||
|
public static func getClosedGroupMemberCount(_ closedGroup: TSGroupThread) -> Int {
|
||
|
return getClosedGroupMembers(closedGroup).count
|
||
|
}
|
||
|
|
||
|
public static func getClosedGroupMemberCount(_ closedGroup: TSGroupThread, with transaction: YapDatabaseReadTransaction) -> Int {
|
||
|
return getClosedGroupMembers(closedGroup, with: transaction).count
|
||
|
}
|
||
|
}
|