mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2025-03-14 09:45:42 +00:00
change
This commit is contained in:
parent
05d1c5878a
commit
2e08197961
2 changed files with 1 additions and 14 deletions
|
@ -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))
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue