bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/presentation/cursor/service.js

20 lines
452 B
JavaScript
Raw Normal View History

import Cursor from '/imports/ui/components/cursor/service';
import Users from '/imports/api/users';
2017-08-15 08:15:11 +08:00
const getCurrentCursor = (cursorId) => {
const cursor = Cursor.findOne({ _id: cursorId });
if (cursor) {
const { userId } = cursor;
2022-05-12 05:58:16 +08:00
const user = Users.findOne({ userId }, { fields: { name: 1 } });
2017-08-15 08:15:11 +08:00
if (user) {
cursor.userName = user.name;
2017-08-15 08:15:11 +08:00
return cursor;
}
}
return false;
};
export default {
getCurrentCursor,
};