mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 08:26:16 -04:00
tests and fix up sloppy code by original author
This commit is contained in:
parent
c705a058fb
commit
32a09ff461
3 changed files with 120 additions and 7 deletions
|
@ -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();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue