bigbluebutton-Github/bigbluebutton-html5/imports/api/chat/server/handlers/chatMessage.js
2016-10-19 12:18:47 +00:00

18 lines
570 B
JavaScript

import Logger from '/imports/startup/server/logger';
import { check } from 'meteor/check';
import addChatToCollection from '../modifiers/addChatToCollection';
export default function handleChatMessage({ payload, header }) {
const message = payload.message;
const meetingId = payload.meeting_id;
check(meetingId, String);
check(message, Object);
// use current_time instead of message.from_time so that the
// chats from Flash and HTML5 have uniform times
message.from_time = +(header.current_time);
return addChatToCollection(meetingId, message);
};