prevent viewers seeing other viewers when hidden from userlist
This commit is contained in:
parent
970a85a095
commit
dc1dd17d8a
@ -22,6 +22,7 @@ export default function startTyping(meetingId, userId, chatId) {
|
||||
userId,
|
||||
name: user.name,
|
||||
isTypingTo: chatId,
|
||||
role: user.role,
|
||||
time: (new Date()),
|
||||
};
|
||||
|
||||
|
@ -3,6 +3,7 @@ import { withTracker } from 'meteor/react-meteor-data';
|
||||
import Auth from '/imports/ui/services/auth';
|
||||
import { UsersTyping } from '/imports/api/group-chat-msg';
|
||||
import Users from '/imports/api/users';
|
||||
import Meetings from '/imports/api/meetings';
|
||||
import TypingIndicator from './component';
|
||||
|
||||
const CHAT_CONFIG = Meteor.settings.public.chat;
|
||||
@ -19,31 +20,39 @@ class TypingIndicatorContainer extends PureComponent {
|
||||
|
||||
export default withTracker(() => {
|
||||
const idChatOpen = Session.get('idChatOpen');
|
||||
const meeting = Meetings.findOne({ meetingId: Auth.meetingID }, {
|
||||
fields: {
|
||||
'lockSettingsProps.hideUserList': 1,
|
||||
},
|
||||
});
|
||||
|
||||
let selector = {
|
||||
const selector = {
|
||||
meetingId: Auth.meetingID,
|
||||
isTypingTo: PUBLIC_CHAT_KEY,
|
||||
};
|
||||
|
||||
if (idChatOpen !== PUBLIC_CHAT_KEY) {
|
||||
selector = {
|
||||
meetingId: Auth.meetingID,
|
||||
isTypingTo: Auth.userID,
|
||||
userId: idChatOpen,
|
||||
};
|
||||
selector.isTypingTo = Auth.userID;
|
||||
selector.userId = idChatOpen;
|
||||
}
|
||||
|
||||
const typingUsers = UsersTyping.find(selector).fetch();
|
||||
|
||||
const currentUser = Users.findOne({
|
||||
meetingId: Auth.meetingID,
|
||||
userId: Auth.userID,
|
||||
}, {
|
||||
fields: {
|
||||
userId: 1,
|
||||
role: 1,
|
||||
},
|
||||
});
|
||||
|
||||
if (meeting.lockSettingsProps.hideUserList && currentUser.role === 'VIEWER') {
|
||||
selector.role = { $ne: 'VIEWER' };
|
||||
}
|
||||
|
||||
const typingUsers = UsersTyping.find(selector).fetch();
|
||||
|
||||
|
||||
return {
|
||||
currentUserId: currentUser ? currentUser.userId : null,
|
||||
typingUsers,
|
||||
|
Loading…
Reference in New Issue
Block a user