mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-25 11:05:25 +00:00
feat: implement the default user config list
This commit is contained in:
parent
8d8325f16e
commit
c0a6137818
@ -11,7 +11,6 @@ import org.session.libsession.utilities.ConfigFactoryUpdateListener
|
|||||||
import org.session.libsignal.protos.SignalServiceProtos.SharedConfigMessage
|
import org.session.libsignal.protos.SignalServiceProtos.SharedConfigMessage
|
||||||
import org.thoughtcrime.securesms.database.ConfigDatabase
|
import org.thoughtcrime.securesms.database.ConfigDatabase
|
||||||
import org.thoughtcrime.securesms.util.ConfigurationMessageUtilities
|
import org.thoughtcrime.securesms.util.ConfigurationMessageUtilities
|
||||||
import java.util.concurrent.ConcurrentSkipListSet
|
|
||||||
|
|
||||||
class ConfigFactory(private val context: Context,
|
class ConfigFactory(private val context: Context,
|
||||||
private val configDatabase: ConfigDatabase,
|
private val configDatabase: ConfigDatabase,
|
||||||
@ -29,10 +28,8 @@ class ConfigFactory(private val context: Context,
|
|||||||
|
|
||||||
private val userLock = Object()
|
private val userLock = Object()
|
||||||
private var _userConfig: UserProfile? = null
|
private var _userConfig: UserProfile? = null
|
||||||
private val userHashes = ConcurrentSkipListSet<String>()
|
|
||||||
private val contactsLock = Object()
|
private val contactsLock = Object()
|
||||||
private var _contacts: Contacts? = null
|
private var _contacts: Contacts? = null
|
||||||
private val contactsHashes = ConcurrentSkipListSet<String>()
|
|
||||||
private val convoVolatileLock = Object()
|
private val convoVolatileLock = Object()
|
||||||
private var _convoVolatileConfig: ConversationVolatileConfig? = null
|
private var _convoVolatileConfig: ConversationVolatileConfig? = null
|
||||||
private val userGroupsLock = Object()
|
private val userGroupsLock = Object()
|
||||||
@ -102,6 +99,8 @@ class ConfigFactory(private val context: Context,
|
|||||||
_userGroups
|
_userGroups
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun getUserConfigs(): List<ConfigBase> = listOfNotNull(user, contacts, convoVolatile, userGroups)
|
||||||
|
|
||||||
|
|
||||||
private fun persistUserConfigDump() = synchronized(userLock) {
|
private fun persistUserConfigDump() = synchronized(userLock) {
|
||||||
val dumped = user?.dump() ?: return
|
val dumped = user?.dump() ?: return
|
||||||
|
Loading…
Reference in New Issue
Block a user