summaryrefslogtreecommitdiff
path: root/src/node/db
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/db
parentc705a058fbf7764c6da7625229e051f3aa70fb2b (diff)
downloadetherpad-lite-32a09ff461039b8619accdccb64a72f58127b195.zip
tests and fix up sloppy code by original author
Diffstat (limited to 'src/node/db')
-rw-r--r--src/node/db/API.js10
1 files changed, 5 insertions, 5 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();
});
}