summaryrefslogtreecommitdiff
path: root/src/node
diff options
context:
space:
mode:
authorJohn McLear <john@mclear.co.uk>2015-04-01 13:52:56 +0100
committerJohn McLear <john@mclear.co.uk>2015-04-01 13:52:56 +0100
commit32a09ff461039b8619accdccb64a72f58127b195 (patch)
treee559cc4884178aeb95ec97cf022480329fc55129 /src/node
parentc705a058fbf7764c6da7625229e051f3aa70fb2b (diff)
downloadetherpad-lite-32a09ff461039b8619accdccb64a72f58127b195.zip
tests and fix up sloppy code by original author
Diffstat (limited to 'src/node')
-rw-r--r--src/node/db/API.js10
-rw-r--r--src/node/handler/APIHandler.js4
2 files changed, 7 insertions, 7 deletions
diff --git a/src/node/db/API.js b/src/node/db/API.js
index 77546bd2..edd130e2 100644
--- a/src/node/db/API.js
+++ b/src/node/db/API.js
@@ -432,8 +432,8 @@ getChatHistory(padId, start, end), returns a part of or the whole chat-history o
Example returns:
-{"code":0,"message":"ok","data":{"messages":[{"text":"foo","userId":"a.foo","time":1359199533759,"userName":"test"},
- {"text":"bar","userId":"a.foo","time":1359199534622,"userName":"test"}]}}
+{"code":0,"message":"ok","data":{"messages":[{"text":"foo","authorID":"a.foo","time":1359199533759,"userName":"test"},
+ {"text":"bar","authorID":"a.foo","time":1359199534622,"userName":"test"}]}}
{code: 1, message:"start is higher or equal to the current chatHead", data: null}
@@ -495,14 +495,14 @@ exports.getChatHistory = function(padID, start, end, callback)
}
/**
-appendChatMessage(padID, text, userID, time), creates a chat message for the pad id
+appendChatMessage(padID, text, authorID, time), creates a chat message for the pad id, time is a timestamp
Example returns:
{code: 0, message:"ok", data: null
{code: 1, message:"padID does not exist", data: null}
*/
-exports.appendChatMessage = function(padID, text, userID, time, callback)
+exports.appendChatMessage = function(padID, text, authorID, time, callback)
{
//text is required
if(typeof text != "string")
@@ -516,7 +516,7 @@ exports.appendChatMessage = function(padID, text, userID, time, callback)
{
if(ERR(err, callback)) return;
- pad.appendChatMessage(text, userID, parseInt(time));
+ pad.appendChatMessage(text, authorID, parseInt(time));
callback();
});
}
diff --git a/src/node/handler/APIHandler.js b/src/node/handler/APIHandler.js
index 48aa6cbc..a9df3abc 100644
--- a/src/node/handler/APIHandler.js
+++ b/src/node/handler/APIHandler.js
@@ -438,13 +438,13 @@ var version =
, "getChatHistory" : ["padID"]
, "getChatHistory" : ["padID", "start", "end"]
, "getChatHead" : ["padID"]
- , "appendChatMessage" : ["padID", "text", "userID", "time"]
+ , "appendChatMessage" : ["padID", "text", "authorID", "time"]
, "restoreRevision" : ["padID", "rev"]
}
};
// set the latest available API version here
-exports.latestApiVersion = '1.2.11';
+exports.latestApiVersion = '1.2.12';
// exports the versions so it can be used by the new Swagger endpoint
exports.version = version;