搜索:判断某个成员是不是禁言

This commit is contained in:
cbb
2026-02-12 17:51:42 +08:00
parent a040b56c74
commit 2191f46317
16 changed files with 388 additions and 212 deletions

View File

@@ -4,7 +4,8 @@ import TUIChatEngine, {
StoreName,
TUITranslateService,
IConversationModel,
SendMessageParams
SendMessageParams,
TUIGroupService
} from '@tencentcloud/chat-uikit-engine-lite'
import { Toast, TOAST_TYPE } from '../../common/Toast/index'
import { isEnabledMessageReadReceiptGlobal } from '../utils/utils'
@@ -13,6 +14,8 @@ import { enableSampleTaskStatus } from '../../../utils/enableSampleTaskStatus'
import OfflinePushInfoManager, {
IOfflinePushInfoCreateParams
} from '../offlinePushInfoManager/index'
import { useAuthUser } from '../../../../composables/useAuthUser'
import { useUI } from '../../../../utils/use-ui'
export const sendMessageErrorCodeMap: Map<number, string> = new Map([
[3123, '文本包含本地审核拦截词'],
@@ -59,6 +62,8 @@ export const sendMessages = async (
messageList: ITipTapEditorContent[],
currentConversation: IConversationModel
) => {
const { tencentUserSig } = useAuthUser()
const { showDialog } = useUI()
// In case of messageJumping, the sent message is automatically cleared and returns to the bottom
if (TUIStore.getData(StoreName.CHAT, 'messageSource')) {
TUIStore.update(StoreName.CHAT, 'messageSource', undefined)
@@ -108,7 +113,36 @@ export const sendMessages = async (
} else {
try {
console.log('发送成功')
await TUIChatService.sendTextMessage(options, sendMessageOptions);
if (currentConversation?.groupProfile?.groupID) {
console.log(
'群发送==',
currentConversation?.groupProfile?.groupID
)
const res = await TUIGroupService.getGroupMemberProfile({
groupID: currentConversation?.groupProfile?.groupID,
userIDList: [tencentUserSig.value.userId]
})
if (res.data.memberList[0].role === 'Member') {
const g = await TUIGroupService.getGroupProfile({
groupID: currentConversation?.groupProfile?.groupID
})
if (g.data.group.muteAllMembers) {
showDialog('提示', '当前群组已全员禁言', false)
} else {
// 判断某个成员是不是禁言
}
} else {
await TUIChatService.sendTextMessage(
options,
sendMessageOptions
)
}
return
}
await TUIChatService.sendTextMessage(
options,
sendMessageOptions
)
} catch (err) {
console.log('发送失败,对方不是你的好友')
}