feat: Enhance logging and state management in ChatsList and MessageRepository for improved user experience
This commit is contained in:
@@ -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)}...")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user