From 2e081979611992c303ec5af9886998340bf1bb05 Mon Sep 17 00:00:00 2001 From: Avently <7953703+avently@users.noreply.github.com> Date: Thu, 9 Jan 2025 18:30:02 +0700 Subject: [PATCH] change --- .../kotlin/chat/simplex/common/model/ChatModel.kt | 11 ----------- .../simplex/common/views/chat/item/ChatItemView.kt | 4 +--- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/ChatModel.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/ChatModel.kt index 746d5c5d2f..5b05d033c8 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/ChatModel.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/model/ChatModel.kt @@ -2971,17 +2971,6 @@ class CIQuote ( } } - fun canModerate(chatInfo: ChatInfo, allowSentItems: Boolean): Boolean { - val member = memberToModerate(chatInfo) - if (member != null) return true - - if (allowSentItems && chatInfo is ChatInfo.Group && chatDir is CIDirection.GroupSnd/* && meta.itemDeleted == null*/) { - val m = chatInfo.groupInfo.membership - return m.memberRole >= GroupMemberRole.Admin - } - return false - } - companion object { fun getSample(itemId: Long?, sentAt: Instant, text: String, chatDir: CIDirection?): CIQuote = CIQuote(chatDir = chatDir, itemId = itemId, sentAt = sentAt, content = MsgContent.MCText(text)) diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/item/ChatItemView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/item/ChatItemView.kt index e464f2cd9d..d5fb33fc57 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/item/ChatItemView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/item/ChatItemView.kt @@ -314,10 +314,8 @@ fun ChatItemView( ArchiveReportItemAction(cItem, showMenu, deleteMessageAsync) val qItem = cItem.quotedItem if (qItem != null) { + ModerateReportItemAction(rhId, cInfo, cItem, qItem, showMenu, deleteMessage) val rMember = qItem.memberToModerate(cInfo) - if (rMember != null || qItem.canModerate(cInfo, true)) { - ModerateReportItemAction(rhId, cInfo, cItem, qItem, showMenu, deleteMessage) - } if (rMember != null && !rMember.blockedByAdmin && rMember.canBlockForAll(cInfo.groupInfo)) { BlockMemberAction( rhId,