android, desktop: narrow condition for showing reported count toolbar (to avoid showing it to regular members who received reports due to a bug in older version) (#5894)

This commit is contained in:
spaced4ndy 2025-05-12 14:40:36 +00:00 committed by GitHub
parent 9e60ce7a60
commit c0b9a0e094
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -833,7 +833,7 @@ fun ChatLayout(
} }
val reportsCount = reportsCount(chatInfo?.id) val reportsCount = reportsCount(chatInfo?.id)
if (oneHandUI.value && chatBottomBar.value) { if (oneHandUI.value && chatBottomBar.value) {
if (chatsCtx.contentTag == null && reportsCount > 0) { if (chatInfo is ChatInfo.Group && chatInfo.groupInfo.canModerate && chatsCtx.contentTag == null && reportsCount > 0) {
ReportedCountToolbar(reportsCount, withStatusBar = true, showGroupReports) ReportedCountToolbar(reportsCount, withStatusBar = true, showGroupReports)
} else { } else {
StatusBarBackground() StatusBarBackground()
@ -865,7 +865,7 @@ fun ChatLayout(
SelectedItemsCounterToolbar(selectedChatItems, !oneHandUI.value || !chatBottomBar.value) SelectedItemsCounterToolbar(selectedChatItems, !oneHandUI.value || !chatBottomBar.value)
} }
} }
if (chatsCtx.contentTag == null && reportsCount > 0 && (!oneHandUI.value || !chatBottomBar.value)) { if (chatInfo is ChatInfo.Group && chatInfo.groupInfo.canModerate && chatsCtx.contentTag == null && reportsCount > 0 && (!oneHandUI.value || !chatBottomBar.value)) {
ReportedCountToolbar(reportsCount, withStatusBar = false, showGroupReports) ReportedCountToolbar(reportsCount, withStatusBar = false, showGroupReports)
} }
} }