mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-25 02:55:23 +00:00
clearAll + same name checking before updating
This commit is contained in:
parent
d21cb39824
commit
6abe6c682c
@ -441,7 +441,13 @@ class ConfigFactory @Inject constructor(
|
||||
}
|
||||
|
||||
fun clearAll() {
|
||||
//TODO: clear all configs
|
||||
synchronized(userConfigs) {
|
||||
userConfigs.clear()
|
||||
}
|
||||
|
||||
synchronized(groupConfigs) {
|
||||
groupConfigs.clear()
|
||||
}
|
||||
}
|
||||
|
||||
private class GroupSubAccountSwarmAuth(
|
||||
|
@ -826,8 +826,17 @@ class GroupManagerV2Impl @Inject constructor(
|
||||
withContext(dispatcher) {
|
||||
val adminKey = requireAdminAccess(groupId)
|
||||
|
||||
configFactory.withMutableGroupConfigs(groupId) {
|
||||
it.groupInfo.setName(newName)
|
||||
val nameChanged = configFactory.withMutableGroupConfigs(groupId) { configs ->
|
||||
if (configs.groupInfo.getName() != newName) {
|
||||
configs.groupInfo.setName(newName)
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
if (!nameChanged) {
|
||||
return@withContext
|
||||
}
|
||||
|
||||
val timestamp = clock.currentTimeMills()
|
||||
|
Loading…
Reference in New Issue
Block a user