feat: add avatar presence handling in OtherProfileScreen for improved scroll behavior
This commit is contained in:
@@ -285,6 +285,31 @@ class MessageRepository private constructor(private val context: Context) {
|
||||
// 🔥 КРИТИЧНО: Обновляем диалог через updateDialogFromMessages
|
||||
dialogDao.updateDialogFromMessages(account, toPublicKey)
|
||||
|
||||
// 📁 Для saved messages - гарантируем создание/обновление dialog
|
||||
if (isSavedMessages) {
|
||||
val existing = dialogDao.getDialog(account, account)
|
||||
dialogDao.insertDialog(
|
||||
com.rosetta.messenger.database.DialogEntity(
|
||||
id = existing?.id ?: 0,
|
||||
account = account,
|
||||
opponentKey = account,
|
||||
opponentTitle = existing?.opponentTitle ?: "Saved Messages",
|
||||
opponentUsername = existing?.opponentUsername ?: "",
|
||||
lastMessage = encryptedPlainMessage,
|
||||
lastMessageTimestamp = timestamp,
|
||||
unreadCount = 0,
|
||||
isOnline = 0,
|
||||
lastSeen = existing?.lastSeen ?: 0,
|
||||
verified = existing?.verified ?: 0,
|
||||
iHaveSent = 1,
|
||||
lastMessageFromMe = 1,
|
||||
lastMessageDelivered = 1,
|
||||
lastMessageRead = 1,
|
||||
lastMessageAttachments = serializeAttachments(attachments)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
// 🔥 Логируем что записалось в диалог
|
||||
val dialog = dialogDao.getDialog(account, toPublicKey)
|
||||
MessageLogger.logDialogUpdate(
|
||||
|
||||
Reference in New Issue
Block a user