feat: Bump version to 1.0.9 and update release notes; remove debug logs functionality

This commit is contained in:
2026-02-26 16:02:01 +05:00
parent f526a442b0
commit 388d279ea9
10 changed files with 147 additions and 125 deletions

View File

@@ -77,7 +77,6 @@ import com.rosetta.messenger.data.ForwardManager
import com.rosetta.messenger.data.MessageRepository
import com.rosetta.messenger.database.RosettaDatabase
import com.rosetta.messenger.network.AttachmentType
import com.rosetta.messenger.network.ProtocolManager
import com.rosetta.messenger.network.SearchUser
import com.rosetta.messenger.repository.AvatarRepository
import com.rosetta.messenger.ui.chats.attach.ChatAttachAlert
@@ -402,18 +401,11 @@ fun ChatDetailScreen(
}
}
DisposableEffect(Unit) {
ProtocolManager.enableUILogs(true)
onDispose { ProtocolManager.enableUILogs(false) }
}
// Состояние выпадающего меню
var showMenu by remember { mutableStateOf(false) }
var showDebugLogs by remember { mutableStateOf(false) }
var showDeleteConfirm by remember { mutableStateOf(false) }
var showBlockConfirm by remember { mutableStateOf(false) }
var showUnblockConfirm by remember { mutableStateOf(false) }
val debugLogs by ProtocolManager.debugLogs.collectAsState()
// Наблюдаем за статусом блокировки в реальном времени через Flow
val isBlocked by
database.blacklistDao()
@@ -606,7 +598,7 @@ fun ChatDetailScreen(
// forwardTrigger добавлен чтобы перезагрузить диалог при forward в тот же чат
LaunchedEffect(user.publicKey, forwardTrigger) {
viewModel.setUserKeys(currentUserPublicKey, currentUserPrivateKey)
viewModel.openDialog(user.publicKey, user.title, user.username)
viewModel.openDialog(user.publicKey, user.title, user.username, user.verified)
viewModel.markVisibleMessagesAsRead()
// 🔥 Убираем уведомление этого чата из шторки при заходе
com.rosetta.messenger.push.RosettaFirebaseMessagingService
@@ -1221,10 +1213,6 @@ fun ChatDetailScreen(
isSystemAccount,
isBlocked =
isBlocked,
onLogsClick = {
showMenu = false
showDebugLogs = true
},
onBlockClick = {
showMenu =
false
@@ -2745,15 +2733,5 @@ fun ChatDetailScreen(
)
}
if (showDebugLogs) {
DebugLogsBottomSheet(
logs = debugLogs,
isDarkTheme = isDarkTheme,
onDismiss = { showDebugLogs = false },
onClearLogs = { ProtocolManager.clearLogs() }
)
}
}
}

View File

@@ -110,6 +110,7 @@ class ChatViewModel(application: Application) : AndroidViewModel(application) {
// Информация о собеседнике
private var opponentTitle: String = ""
private var opponentUsername: String = ""
private var opponentVerified: Int = 0
// Текущий диалог
private var opponentKey: String? = null
@@ -534,7 +535,7 @@ class ChatViewModel(application: Application) : AndroidViewModel(application) {
}
/** Открыть диалог */
fun openDialog(publicKey: String, title: String = "", username: String = "") {
fun openDialog(publicKey: String, title: String = "", username: String = "", verified: Int = 0) {
// 🔥 ВСЕГДА перезагружаем данные - не кешируем, т.к. диалог мог быть удалён
// if (opponentKey == publicKey) {
@@ -547,6 +548,7 @@ class ChatViewModel(application: Application) : AndroidViewModel(application) {
opponentKey = publicKey
opponentTitle = title
opponentUsername = username
opponentVerified = verified.coerceAtLeast(0)
// 📨 СНАЧАЛА проверяем ForwardManager - ДО сброса состояния!
// Это важно для правильного отображения forward сообщений сразу
@@ -1774,7 +1776,7 @@ class ChatViewModel(application: Application) : AndroidViewModel(application) {
title = opponentTitle,
username = opponentUsername,
publicKey = publicKey,
verified = 0,
verified = opponentVerified,
online = 0
)
}
@@ -1791,7 +1793,7 @@ class ChatViewModel(application: Application) : AndroidViewModel(application) {
title = dialog.opponentTitle,
username = dialog.opponentUsername,
publicKey = publicKey,
verified = 0,
verified = dialog.verified,
online = 0
)
}
@@ -3569,8 +3571,8 @@ class ChatViewModel(application: Application) : AndroidViewModel(application) {
// 🔥 FIX: updateDialogFromMessages создаёт новый диалог с пустым title/username
// когда диалога ещё не было. Обновляем метаданные из уже известных данных.
if (opponent != account && opponentTitle.isNotEmpty()) {
dialogDao.updateOpponentInfo(
account, opponent, opponentTitle, opponentUsername, 0
dialogDao.updateOpponentDisplayName(
account, opponent, opponentTitle, opponentUsername
)
}
} catch (e: Exception) {}
@@ -3602,8 +3604,8 @@ class ChatViewModel(application: Application) : AndroidViewModel(application) {
// 🔥 FIX: Сохраняем title/username после пересчёта счётчиков
if (opponentKey != account && opponentTitle.isNotEmpty()) {
dialogDao.updateOpponentInfo(
account, opponentKey, opponentTitle, opponentUsername, 0
dialogDao.updateOpponentDisplayName(
account, opponentKey, opponentTitle, opponentUsername
)
}
} catch (e: Exception) {}

View File

@@ -235,8 +235,7 @@ fun ChatsListScreen(
avatarRepository: com.rosetta.messenger.repository.AvatarRepository? = null,
onAddAccount: () -> Unit = {},
onSwitchAccount: (String) -> Unit = {},
onDeleteAccountFromSidebar: (String) -> Unit = {},
onLogsClick: () -> Unit = {}
onDeleteAccountFromSidebar: (String) -> Unit = {}
) {
// Theme transition state
var hasInitialized by remember { mutableStateOf(false) }
@@ -1149,22 +1148,6 @@ fun ChatsListScreen(
}
)
// 📋 Logs
DrawerMenuItemEnhanced(
icon = TablerIcons.Bug,
text = "Logs",
iconColor = menuIconColor,
textColor = menuTextColor,
onClick = {
scope.launch {
drawerState.close()
kotlinx.coroutines
.delay(100)
onLogsClick()
}
}
)
}
// ═══════════════════════════════════════════════════════════

View File

@@ -3,25 +3,14 @@ package com.rosetta.messenger.ui.chats.components
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.flow.update
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale
object AttachmentDownloadDebugLogger {
private const val MAX_LOGS = 1000
private val dateFormat = SimpleDateFormat("HH:mm:ss.SSS", Locale.getDefault())
private val _logs = MutableStateFlow<List<String>>(emptyList())
val logs: StateFlow<List<String>> = _logs.asStateFlow()
fun log(message: String) {
val timestamp = dateFormat.format(Date())
val line = "[$timestamp] 🖼️ $message"
_logs.update { current -> (current + line).takeLast(MAX_LOGS) }
// Всегда дублируем в debug logs чата напрямую через ProtocolManager
// (не через MessageLogger, чтобы обойти isEnabled гейт)
com.rosetta.messenger.network.ProtocolManager.addLog("🖼️ $message")
fun log(@Suppress("UNUSED_PARAMETER") message: String) {
// Disabled by request: no runtime accumulation of photo debug logs.
return
}
fun clear() {

View File

@@ -2370,7 +2370,6 @@ fun KebabMenu(
isSavedMessages: Boolean,
isSystemAccount: Boolean = false,
isBlocked: Boolean,
onLogsClick: () -> Unit,
onBlockClick: () -> Unit,
onUnblockClick: () -> Unit,
onDeleteClick: () -> Unit
@@ -2399,14 +2398,6 @@ fun KebabMenu(
dismissOnClickOutside = true
)
) {
KebabMenuItem(
icon = TelegramIcons.Info,
text = "Debug Logs",
onClick = onLogsClick,
tintColor = iconColor,
textColor = textColor
)
if (!isSavedMessages && !isSystemAccount) {
KebabMenuItem(
icon = if (isBlocked) TelegramIcons.Done else TelegramIcons.Block,