feat: enhance avatar handling and file attachment functionality with improved UI interactions

This commit is contained in:
2026-02-15 11:54:09 +05:00
parent e301478d92
commit b543ef4d6f
11 changed files with 177 additions and 101 deletions

View File

@@ -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