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.
17 lines
761 B
Swift
17 lines
761 B
Swift
|
|
extension Storage {
|
|
|
|
private static let receivedCallsCollection = "LokiReceivedCallsCollection"
|
|
|
|
public func getReceivedCalls(for publicKey: String, using transaction: Any) -> Set<String> {
|
|
var result: Set<String>?
|
|
guard let transaction = transaction as? YapDatabaseReadTransaction else { return [] }
|
|
result = transaction.object(forKey: publicKey, inCollection: Storage.receivedCallsCollection) as? Set<String>
|
|
return result ?? []
|
|
}
|
|
|
|
public func setReceivedCalls(to receivedCalls: Set<String>, for publicKey: String, using transaction: Any) {
|
|
(transaction as! YapDatabaseReadWriteTransaction).setObject(receivedCalls, forKey: publicKey, inCollection: Storage.receivedCallsCollection)
|
|
}
|
|
}
|