feat: fix group persist and select contact list search for lowercase on name and query
This commit is contained in:
parent
5a2fdb0e83
commit
0eadfeaaca
|
@ -316,7 +316,7 @@ class ConfigFactory(
|
|||
)
|
||||
}
|
||||
|
||||
override fun persist(forConfigObject: Config, timestamp: Long) {
|
||||
override fun persist(forConfigObject: Config, timestamp: Long, forPublicKey: String?) {
|
||||
try {
|
||||
listeners.forEach { listener ->
|
||||
listener.notifyUpdates(forConfigObject)
|
||||
|
@ -326,6 +326,8 @@ class ConfigFactory(
|
|||
is Contacts -> persistContactsConfigDump(timestamp)
|
||||
is ConversationVolatileConfig -> persistConvoVolatileConfigDump(timestamp)
|
||||
is UserGroupsConfig -> persistUserGroupsConfigDump(timestamp)
|
||||
is GroupMembersConfig -> persistGroupConfigDump(forConfigObject, SessionId.from(forPublicKey!!), timestamp)
|
||||
is GroupInfoConfig -> persistGroupConfigDump(forConfigObject, SessionId.from(forPublicKey!!), timestamp)
|
||||
else -> throw UnsupportedOperationException("Can't support type of ${forConfigObject::class.simpleName} yet")
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
|
|
|
@ -146,7 +146,6 @@ fun CreateGroup(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// Group list
|
||||
|
@ -182,7 +181,8 @@ fun CreateGroup(
|
|||
.fillMaxSize()
|
||||
.background(Color.Gray.copy(alpha = 0.5f))) {
|
||||
CircularProgressIndicator(
|
||||
modifier = Modifier.align(Alignment.Center)
|
||||
modifier = Modifier.align(Alignment.Center),
|
||||
color = MaterialTheme.colors.secondary
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ fun SelectContacts(
|
|||
contactListState
|
||||
.filter { contact ->
|
||||
contact.getSearchName().lowercase()
|
||||
.contains(queryFilter)
|
||||
.contains(queryFilter.lowercase())
|
||||
}
|
||||
.toList()
|
||||
}
|
||||
|
|
|
@ -252,8 +252,9 @@ data class ConfigurationSyncJob(val destination: Destination) : Job {
|
|||
"Successfully removed the deleted hashes from ${config.javaClass.simpleName}"
|
||||
)
|
||||
// dump and write config after successful
|
||||
if (config is ConfigBase && config.needsDump()) { // usually this will be true?
|
||||
configFactory.persist(config, (message.params["timestamp"] as String).toLong())
|
||||
if (config is ConfigBase && config.needsDump()) { // usually this will be true? ))
|
||||
val groupPubKey = if (destination is Destination.ClosedGroup) destination.publicKey else null
|
||||
configFactory.persist(config, (message.params["timestamp"] as String).toLong(), groupPubKey)
|
||||
} else if (config is GroupKeysConfig && config.needsDump()) {
|
||||
Log.d("Loki", "Should persist the GroupKeysConfig")
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ class ClosedGroupPoller(private val scope: CoroutineScope,
|
|||
|
||||
companion object {
|
||||
const val POLL_INTERVAL = 3_000L
|
||||
const val ENABLE_LOGGING = true
|
||||
const val ENABLE_LOGGING = false
|
||||
}
|
||||
|
||||
private var isRunning: Boolean = false
|
||||
|
|
|
@ -26,7 +26,7 @@ interface ConfigFactoryProtocol {
|
|||
free: Boolean = true): GroupKeysConfig?
|
||||
|
||||
fun getUserConfigs(): List<ConfigBase>
|
||||
fun persist(forConfigObject: Config, timestamp: Long)
|
||||
fun persist(forConfigObject: Config, timestamp: Long, forPublicKey: String? = null)
|
||||
|
||||
fun conversationInConfig(publicKey: String?, groupPublicKey: String?, openGroupId: String?, visibleOnly: Boolean): Boolean
|
||||
fun canPerformChange(variant: String, publicKey: String, changeTimestampMs: Long): Boolean
|
||||
|
|
Loading…
Reference in New Issue