feat: add basic contact logic for setting local contact state. Need to implement handling properly

This commit is contained in:
0x330a
2023-02-23 17:19:03 +11:00
parent 164810e533
commit 8a000fe5a9
14 changed files with 100 additions and 33 deletions

View File

@@ -204,7 +204,7 @@ interface StorageProtocol {
fun removeReaction(emoji: String, messageTimestamp: Long, author: String, notifyUnread: Boolean)
fun updateReactionIfNeeded(message: Message, sender: String, openGroupSentTimestamp: Long)
fun deleteReactions(messageId: Long, mms: Boolean)
fun unblock(toUnblock: List<Recipient>)
fun setBlocked(recipients: List<Recipient>, isBlocked: Boolean)
fun blockedContacts(): List<Recipient>
// Shared configs

View File

@@ -150,7 +150,9 @@ data class ConfigurationSyncJob(val destination: Destination): Job {
// store the new hash in list of hashes to track against
configFactory.appendHash(config, insertHash)
// dump and write config after successful
configFactory.persist(config)
if (config.needsDump()) { // usually this will be true?
configFactory.persist(config)
}
}
} catch (e: Exception) {
Log.e(TAG, "Error performing batch request", e)

View File

@@ -163,7 +163,9 @@ class Poller(private val configFactory: ConfigFactoryProtocol, debounceTimer: Ti
}
}
// process new results
configFactory.persist(forConfigObject)
if (forConfigObject.needsDump()) {
configFactory.persist(forConfigObject)
}
}
private fun poll(snode: Snode, deferred: Deferred<Unit, Exception>): Promise<Unit, Exception> {