mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-20 15:48:39 +00:00
feat: start to implement group list info classes and wrappers and refactor to use library based hashes
This commit is contained in:
@@ -121,29 +121,4 @@ class ConfigFactory(private val context: Context,
|
||||
}
|
||||
}
|
||||
|
||||
override fun appendHash(configObject: ConfigBase, hash: String) {
|
||||
when (configObject) {
|
||||
is UserProfile -> userHashes.add(hash)
|
||||
is Contacts -> contactsHashes.add(hash)
|
||||
is ConversationVolatileConfig -> convoHashes.add(hash)
|
||||
else -> throw UnsupportedOperationException("Can't support type of ${configObject::class.simpleName} yet")
|
||||
}
|
||||
}
|
||||
|
||||
override fun getHashesFor(forConfigObject: ConfigBase): List<String> =
|
||||
when (forConfigObject) {
|
||||
is UserProfile -> userHashes.toList()
|
||||
is Contacts -> contactsHashes.toList()
|
||||
is ConversationVolatileConfig -> convoHashes.toList()
|
||||
else -> throw UnsupportedOperationException("Can't support type of ${forConfigObject::class.simpleName} yet")
|
||||
}
|
||||
|
||||
override fun removeHashesFor(forConfigObject: ConfigBase, deletedHashes: Set<String>) =
|
||||
when (forConfigObject) {
|
||||
is UserProfile -> userHashes.removeAll(deletedHashes)
|
||||
is Contacts -> contactsHashes.removeAll(deletedHashes)
|
||||
is ConversationVolatileConfig -> convoHashes.removeAll(deletedHashes)
|
||||
else -> throw UnsupportedOperationException("Can't support type of ${forConfigObject::class.simpleName} yet")
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user