diff --git a/package1/ieBrowser/chat.vue b/package1/ieBrowser/chat.vue index 69fba3a..2f15c20 100644 --- a/package1/ieBrowser/chat.vue +++ b/package1/ieBrowser/chat.vue @@ -898,6 +898,10 @@ }) ieSocket.onMessage((msg) => { if (String(msg.roomId) !== String(this.roomId)) return + if (msg.type === 'blockStatus') { + this.applyBlockStatusEvent(msg) + return + } if (this.messages.some(item => String(item.messageId) === String(msg.messageId))) return if (msg.clientMsgId && this.messages.some(item => item.clientMsgId === msg.clientMsgId)) { this.applyAck(msg) @@ -932,6 +936,26 @@ ieSocket.subscribeRoom(this.roomId) }) }, + applyBlockStatusEvent(msg) { + const selfId = String(uni.getStorageSync('id') || '') + const targetId = String(this.targetUserId || '') + const userId = String(msg.userId || '') + const eventTargetId = String(msg.targetUserId || '') + const status = userId === selfId ? msg.userStatus : (eventTargetId === selfId ? msg.targetStatus : null) + if (status) { + this.blockedByMe = !!status.blockedByMe + this.blockedByOther = !!status.blockedByOther + this.isBlocked = !!status.blocked + if (this.isBlocked) { + this.showEmoji = false + this.voiceMode = false + } + return + } + if (userId === targetId || eventTargetId === targetId) { + this.loadBlockStatus() + } + }, back() { uni.redirectTo({ url: '/package1/ieBrowser/index' }) }