parent
fec1bc0d4a
commit
9b7108d730
|
@ -466,18 +466,13 @@ const handleGetChatMessages = async (socket, {data: {start, end}}) => {
|
||||||
if (count < 0 || count > 100) throw new Error(`invalid number of messages: ${count}`);
|
if (count < 0 || count > 100) throw new Error(`invalid number of messages: ${count}`);
|
||||||
const {padId, author: authorId} = sessioninfos[socket.id];
|
const {padId, author: authorId} = sessioninfos[socket.id];
|
||||||
const pad = await padManager.getPad(padId, null, authorId);
|
const pad = await padManager.getPad(padId, null, authorId);
|
||||||
|
socket.json.send({
|
||||||
const chatMessages = await pad.getChatMessages(start, end);
|
|
||||||
const infoMsg = {
|
|
||||||
type: 'COLLABROOM',
|
type: 'COLLABROOM',
|
||||||
data: {
|
data: {
|
||||||
type: 'CHAT_MESSAGES',
|
type: 'CHAT_MESSAGES',
|
||||||
messages: chatMessages,
|
messages: await pad.getChatMessages(start, end),
|
||||||
},
|
},
|
||||||
};
|
});
|
||||||
|
|
||||||
// send the messages back to the client
|
|
||||||
socket.json.send(infoMsg);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue