feat: Enhance logging and state management in ChatsList and MessageRepository for improved user experience

This commit is contained in:
k1ngsterr1
2026-01-18 21:48:02 +05:00
parent f141145245
commit 89d639a474
4 changed files with 51 additions and 10 deletions

View File

@@ -572,10 +572,19 @@ class MessageRepository private constructor(private val context: Context) {
suspend fun updateDialogUserInfo(publicKey: String, title: String, username: String, verified: Int) {
val account = currentAccount ?: return
android.util.Log.d("MessageRepo", "🔄 updateDialogUserInfo: ${publicKey.take(16)}... title='$title' username='$username'")
// Проверяем существует ли диалог с этим пользователем
val existing = dialogDao.getDialog(account, publicKey)
if (existing != null) {
android.util.Log.d("MessageRepo", "✅ Updating dialog opponent info in DB for ${publicKey.take(16)}...")
dialogDao.updateOpponentInfo(account, publicKey, title, username, verified)
// 🔥 Проверим что данные сохранились
val updated = dialogDao.getDialog(account, publicKey)
android.util.Log.d("MessageRepo", "📝 After update: title='${updated?.opponentTitle}' username='${updated?.opponentUsername}'")
} else {
android.util.Log.w("MessageRepo", "⚠️ Dialog not found for ${publicKey.take(16)}...")
}
}