feat: enhance avatar handling and file attachment functionality with improved UI interactions
This commit is contained in:
@@ -139,9 +139,15 @@ class MessageRepository private constructor(private val context: Context) {
|
||||
/** Инициализация с текущим аккаунтом */
|
||||
fun initialize(publicKey: String, privateKey: String) {
|
||||
val start = System.currentTimeMillis()
|
||||
// 🔥 Очищаем кэш запрошенных user info при смене аккаунта
|
||||
// 🔥 Очищаем кэши при смене аккаунта
|
||||
if (currentAccount != publicKey) {
|
||||
requestedUserInfoKeys.clear()
|
||||
// Clear message Flow cache — dialogKey is account-independent (sorted pair),
|
||||
// so stale Flows from previous account would return wrong data
|
||||
messageCache.clear()
|
||||
// Clear processed messageIds — prevents blocking delivery of messages
|
||||
// that were already processed under the previous account
|
||||
clearProcessedCache()
|
||||
}
|
||||
|
||||
currentAccount = publicKey
|
||||
|
||||
Reference in New Issue
Block a user