bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/whiteboard/cursors/service.js

26 lines
737 B
JavaScript
Raw Normal View History

2022-04-05 22:49:13 +08:00
import Cursor from '/imports/ui/components/cursor/service';
import Users from '/imports/api/users';
import Presentations from '/imports/api/presentations';
const getCurrentCursor = (cursorId) => {
const cursor = Cursor.findOne({ _id: cursorId });
if (cursor) {
const { userId } = cursor;
const user = Users.findOne({ userId }, { fields: { name: 1 } });
if (user) {
cursor.userName = user.name;
return cursor;
}
}
return false;
};
const getCursorCur = () => {
// console.log('GET cursors : ', Presentations.find().fetch().filter(s => s.x && s.y))
return Presentations.find().fetch().filter(s => s.x && s.y);
};
export default {
getCurrentCursor,
getCursorCur,
};