Making sure restored accounts do not display deleted messages

When getting messages we check if the contact was marked as hidden and compare the timestamps of both the message and the config object to check whether to re-show the thread or not.
This commit is contained in:
ThomasSession
2024-10-14 10:42:10 +11:00
parent 2945a9231b
commit bf6157997a
4 changed files with 46 additions and 6 deletions

View File

@@ -196,6 +196,18 @@ class ConfigFactory(
}
}
override fun getConfigTimestamp(forConfigObject: ConfigBase, publicKey: String): Long {
val variant = when (forConfigObject) {
is UserProfile -> SharedConfigMessage.Kind.USER_PROFILE.name
is Contacts -> SharedConfigMessage.Kind.CONTACTS.name
is ConversationVolatileConfig -> SharedConfigMessage.Kind.CONVO_INFO_VOLATILE.name
is UserGroupsConfig -> SharedConfigMessage.Kind.GROUPS.name
else -> throw UnsupportedOperationException("Can't support type of ${forConfigObject::class.simpleName} yet")
}
return configDatabase.retrieveConfigLastUpdateTimestamp(variant, publicKey)
}
override fun conversationInConfig(
publicKey: String?,
groupPublicKey: String?,