2016-10-19 20:18:47 +08:00
|
|
|
import Logger from '/imports/startup/server/logger';
|
|
|
|
import { check } from 'meteor/check';
|
2016-10-21 19:56:03 +08:00
|
|
|
import addChat from '../modifiers/addChat';
|
2016-10-19 20:18:47 +08:00
|
|
|
|
|
|
|
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);
|
|
|
|
|
2016-10-21 19:56:03 +08:00
|
|
|
return addChat(meetingId, message);
|
2017-06-03 03:25:02 +08:00
|
|
|
}
|