Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions lib/redis/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,9 @@ const onPadUpdate = (meetingId, groupId, padId, rev) => {
const change = diff(database[meetingId].groups[groupId].pads[padId].html, html);
if (change) {
database[meetingId].groups[groupId].pads[padId].html = html;
logger.info(ids.PAD, 'content', { meetingId, groupId, padId, rev, ...change });
logger.info(ids.PAD, 'content', { meetingId, groupId, padId, rev, html, ...change });

sender.send('padContent', meetingId, { groupId, padId, rev, ...change });
sender.send('padContent', meetingId, { groupId, padId, rev, html, ...change });
}
}).catch(() => logger.error(ids.PAD, 'content', { meetingId, groupId, padId, rev }));
}
Expand Down Expand Up @@ -609,7 +609,7 @@ const deleteGroup = (meetingId, { groupId }) => {
});
};

const createPad = (meetingId, groupId, { name }) => {
const createPad = (meetingId, groupId, { name, initialHtmlContent }) => {
return new Promise((resolve, reject) => {
if (hasGroup(meetingId, groupId)) {
const padId = `${groupId}$${name}`;
Expand All @@ -636,6 +636,11 @@ const createPad = (meetingId, groupId, { name }) => {
logger.trace(ids.PAD, 'created', { meetingId, groupId, padId });

mapper.createPad(meetingId, groupId, padId);
api.call('setHTML', {
padID: padId, html: initialHtmlContent,
}).catch(() => {
logger.error(ids.PAD, 'settingHTML', { meetingId, groupId, padId });
});

sender.send('padCreated', meetingId, { groupId, padId, name });

Expand Down
3 changes: 2 additions & 1 deletion lib/redis/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,10 @@ const handlePadCreate = (header, body) => {
const {
groupId,
name,
initialHtmlContent,
} = body;

database.createPad(meetingId, groupId, { name }).then(() => {
database.createPad(meetingId, groupId, { name, initialHtmlContent }).then(() => {
logger.info(ids.PAD, 'created', { meetingId, groupId, name });
}).catch(() => logger.error(ids.PAD, 'creating', { meetingId, body }));
};
Expand Down