summaryrefslogtreecommitdiff
path: root/src/node/handler/PadMessageHandler.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/node/handler/PadMessageHandler.js')
-rw-r--r--src/node/handler/PadMessageHandler.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/node/handler/PadMessageHandler.js b/src/node/handler/PadMessageHandler.js
index 26748517..e1786b2a 100644
--- a/src/node/handler/PadMessageHandler.js
+++ b/src/node/handler/PadMessageHandler.js
@@ -191,6 +191,11 @@ exports.handleMessage = function(client, message)
handleChatMessage(client, message);
}
else if(message.type == "COLLABROOM" &&
+ message.data.type == "SAVE_REVISION")
+ {
+ handleSaveRevisionMessage(client, message);
+ }
+ else if(message.type == "COLLABROOM" &&
message.data.type == "CLIENT_MESSAGE" &&
message.data.payload.type == "suggestUserName")
{
@@ -204,6 +209,23 @@ exports.handleMessage = function(client, message)
}
/**
+ * Handles a save revision message
+ * @param client the client that send this message
+ * @param message the message from the client
+ */
+function handleSaveRevisionMessage(client, message){
+ var padId = session2pad[client.id];
+ var userId = sessioninfos[client.id].author;
+
+ padManager.getPad(padId, function(err, pad)
+ {
+ if(ERR(err)) return;
+
+ pad.addSavedRevision(pad.head, userId);
+ });
+}
+
+/**
* Handles a Chat Message
* @param client the client that send this message
* @param message the message from the client