|
@@ -158,6 +158,14 @@ const actions = {
|
|
|
let member = msg.data.data.userMap[n.from]
|
|
|
commit('updateMembers', msg.data.data.userMap)
|
|
|
if (!member) return
|
|
|
+
|
|
|
+ // 退群消息只能显示给管理员
|
|
|
+ if (n.msg_type == 5 && n.ext_info && n.ext_info.event_type == 'leave_group') {
|
|
|
+ if (!state.adminList.some(item => item == rootState.userId)) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
dList.push({
|
|
|
name: member ? member.nick_name : 'unknown',
|
|
|
content: n.msg,
|
|
@@ -168,6 +176,7 @@ const actions = {
|
|
|
type: n.from == state.userId ? 'me' : 'you',
|
|
|
msg_type: n.msg_type,
|
|
|
ext: n.ext ? n.ext : null,
|
|
|
+ ext_info: n.ext_info ? n.ext_info : null,
|
|
|
isShowFullInfo: n.from != lastShowMsgUid
|
|
|
})
|
|
|
|
|
@@ -274,6 +283,13 @@ const actions = {
|
|
|
let member = state.members[n.from]
|
|
|
|
|
|
if (!member) return
|
|
|
+ // 退群消息只能显示给管理员
|
|
|
+ if (n.msg_type == 5 && n.ext_info && n.ext_info.event_type == 'leave_group') {
|
|
|
+ if (!state.adminList.some(item => item == rootState.userId)) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 显示信息
|
|
|
list.push({
|
|
|
name: member.nick_name || member.user_name || 'unknown',
|
|
@@ -542,17 +558,9 @@ const actions = {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- if (data.type === 'leave') {
|
|
|
- if (data.group_id != state.groupId) return // 不是本群信息-无响应
|
|
|
+ if (data.type === 'leave' && data.group_id == state.groupId) {
|
|
|
if (data.user_info.user_id == rootState.userId) return // 本人-不走这个ws
|
|
|
|
|
|
- // 退群仅通知管理员
|
|
|
- // let isAdmin = state.adminList.some(item => { return item == rootState.userId })
|
|
|
- // if (isAdmin) {
|
|
|
- // data.joinMsg = (data.user_info.nick_name || data.user_info.name) + '退出群组'
|
|
|
- // commit('addChatItem', data)
|
|
|
- // }
|
|
|
-
|
|
|
// 本人退出刷新群信息
|
|
|
if (data.user_id == rootState.userId) {
|
|
|
dispatch('getGroupInfo')
|
|
@@ -564,8 +572,7 @@ const actions = {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (data.type === 'join') {
|
|
|
- if (data.group_id != state.groupId) return
|
|
|
+ if (data.type === 'join' && data.group_id == state.groupId) {
|
|
|
if (data.user_info.user_id == rootState.userId) return
|
|
|
|
|
|
data.joinMsg = (data.user_info.nick_name || data.user_info.name) + '加入群组'
|
|
@@ -580,11 +587,11 @@ const actions = {
|
|
|
// commit('addChatItem', data)
|
|
|
}
|
|
|
|
|
|
- if (data.type === 'pin_msg') {
|
|
|
+ if (data.type === 'pin_msg' && data.group_id == state.groupId) {
|
|
|
commit('updateGroupPinMsg', data.pinMsg)
|
|
|
}
|
|
|
|
|
|
- if (data.type === 'unpin_msg') {
|
|
|
+ if (data.type === 'unpin_msg' && data.group_id == state.groupId) {
|
|
|
commit('updateGroupPinMsg', null)
|
|
|
}
|
|
|
|