feat: Add logging for packet details before sending, including attachment count and details

This commit is contained in:
k1ngsterr1
2026-01-13 06:02:03 +05:00
parent c52b6c1799
commit bdede2784c
3 changed files with 53 additions and 13 deletions

View File

@@ -224,11 +224,18 @@ fun ChatDetailScreen(
var showEmojiPicker by remember { mutableStateOf(false) }
val emojiPanelHeight = if (imeHeight > 50.dp) imeHeight else 280.dp
// Динамический bottom padding для списка: инпут (~70dp) + клавиатура/эмодзи
// 🔥 Reply/Forward state (нужен для расчёта listBottomPadding)
val replyMessages by viewModel.replyMessages.collectAsState()
val hasReply = replyMessages.isNotEmpty()
// 🔥 Дополнительная высота для reply панели (~50dp)
val replyPanelHeight = if (hasReply) 50.dp else 0.dp
// Динамический bottom padding для списка: инпут (~70dp) + reply (~50dp) + клавиатура/эмодзи
val listBottomPadding = when {
isKeyboardVisible -> 70.dp + imeHeight
showEmojiPicker -> 70.dp + emojiPanelHeight
else -> 100.dp
isKeyboardVisible -> 70.dp + replyPanelHeight + imeHeight
showEmojiPicker -> 70.dp + replyPanelHeight + emojiPanelHeight
else -> 100.dp + replyPanelHeight
}
// Telegram-style scroll tracking
@@ -289,10 +296,8 @@ fun ChatDetailScreen(
val isTyping by viewModel.opponentTyping.collectAsState()
val isOnline by viewModel.opponentOnline.collectAsState()
// 🔥 Reply/Forward state
val replyMessages by viewModel.replyMessages.collectAsState()
// 🔥 Reply/Forward state (replyMessages и hasReply определены выше для listBottomPadding)
val isForwardMode by viewModel.isForwardMode.collectAsState()
val hasReply = replyMessages.isNotEmpty()
// 🔥 Добавляем информацию о датах к сообщениям
// В reversed layout (новые внизу) - показываем дату ПОСЛЕ сообщения (визуально сверху)

View File

@@ -801,6 +801,13 @@ class ChatViewModel(application: Application) : AndroidViewModel(application) {
attachments = messageAttachments
}
// 🔥 Log packet details before sending
ProtocolManager.addLog("📤📤📤 SENDING PACKET 📤📤📤")
ProtocolManager.addLog(" - Attachments count: ${packet.attachments.size}")
packet.attachments.forEach { att ->
ProtocolManager.addLog(" - Attachment: type=${att.type}, id=${att.id}, blob=${att.blob.take(50)}...")
}
// Отправляем пакет
ProtocolManager.send(packet)