Merge pull request #2505 from vitorpamplona/claude/fix-marmot-account-isolation-4Ysv5
Isolate MLS and Marmot stores per account
This commit is contained in:
+6
-5
@@ -100,13 +100,14 @@ class AccountCacheState(
|
|||||||
|
|
||||||
val signerWithClientTag = NostrSignerWithClientTag(signer, CLIENT_TAG_NAME)
|
val signerWithClientTag = NostrSignerWithClientTag(signer, CLIENT_TAG_NAME)
|
||||||
|
|
||||||
|
val accountDir = File(rootFilesDir(), "accounts/${signer.pubKey}").apply { mkdirs() }
|
||||||
|
|
||||||
val mlsStore =
|
val mlsStore =
|
||||||
try {
|
try {
|
||||||
val dir = rootFilesDir()
|
|
||||||
Log.d("AccountCacheState") {
|
Log.d("AccountCacheState") {
|
||||||
"Initializing AndroidMlsGroupStateStore for ${signer.pubKey.take(8)}… at ${dir.absolutePath}"
|
"Initializing AndroidMlsGroupStateStore for ${signer.pubKey.take(8)}… at ${accountDir.absolutePath}"
|
||||||
}
|
}
|
||||||
AndroidMlsGroupStateStore(dir)
|
AndroidMlsGroupStateStore(accountDir)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Log.e(
|
Log.e(
|
||||||
"AccountCacheState",
|
"AccountCacheState",
|
||||||
@@ -121,7 +122,7 @@ class AccountCacheState(
|
|||||||
|
|
||||||
val marmotMessageStore =
|
val marmotMessageStore =
|
||||||
try {
|
try {
|
||||||
AndroidMarmotMessageStore(rootFilesDir())
|
AndroidMarmotMessageStore(accountDir)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Log.e(
|
Log.e(
|
||||||
"AccountCacheState",
|
"AccountCacheState",
|
||||||
@@ -133,7 +134,7 @@ class AccountCacheState(
|
|||||||
|
|
||||||
val marmotKeyPackageStore =
|
val marmotKeyPackageStore =
|
||||||
try {
|
try {
|
||||||
AndroidKeyPackageBundleStore(rootFilesDir())
|
AndroidKeyPackageBundleStore(accountDir)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Log.e(
|
Log.e(
|
||||||
"AccountCacheState",
|
"AccountCacheState",
|
||||||
|
|||||||
Reference in New Issue
Block a user