implement closed group v2 handling and configuration message handling in refactored message receiving pipeline

This commit is contained in:
Ryan ZHAO
2021-02-09 11:45:38 +11:00
parent 05da743ea2
commit 5ceaf87ba9
8 changed files with 379 additions and 164 deletions

View File

@@ -376,6 +376,22 @@ class Storage(context: Context, helper: SQLCipherOpenHelper) : Database(context,
return DatabaseFactory.getSSKDatabase(context).getAllClosedGroupPublicKeys()
}
override fun addClosedGroupPublicKey(groupPublicKey: String) {
DatabaseFactory.getLokiAPIDatabase(context).addClosedGroupPublicKey(groupPublicKey)
}
override fun removeClosedGroupPublicKey(groupPublicKey: String) {
DatabaseFactory.getLokiAPIDatabase(context).removeClosedGroupPublicKey(groupPublicKey)
}
override fun addClosedGroupEncryptionKeyPair(encryptionKeyPair: ECKeyPair, groupPublicKey: String) {
DatabaseFactory.getLokiAPIDatabase(context).addClosedGroupEncryptionKeyPair(encryptionKeyPair, groupPublicKey)
}
override fun removeAllClosedGroupEncryptionKeyPairs(groupPublicKey: String) {
DatabaseFactory.getLokiAPIDatabase(context).removeAllClosedGroupEncryptionKeyPairs(groupPublicKey)
}
override fun getAllOpenGroups(): Map<Long, PublicChat> {
return DatabaseFactory.getLokiThreadDatabase(context).getAllPublicChats()
}