From c8d7e6e0b8f0db79b909800ae4e5393485969f72 Mon Sep 17 00:00:00 2001 From: Stefan Date: Sat, 15 Aug 2015 22:41:09 +0200 Subject: [PATCH 1/2] Add appendChatMessage API to docs --- doc/api/http_api.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/api/http_api.md b/doc/api/http_api.md index 59510a75..9809814b 100644 --- a/doc/api/http_api.md +++ b/doc/api/http_api.md @@ -380,6 +380,16 @@ returns the chatHead (last number of the last chat-message) of the pad * `{code: 0, message:"ok", data: {chatHead: 42}}` * `{code: 1, message:"padID does not exist", data: null}` +#### appendChatMessage(padID, text, authorID [, time]) + * API >= 1.2.12 + +creates a chat message, saves it to the database and sends it to all connected clients of this pad + + +*Example returns:* + +* `{code: 0, message:"ok", data: null}` +* `{code: 1, message:"text is no string", data: null}` ### Pad Group pads are normal pads, but with the name schema GROUPID$PADNAME. A security manager controls access of them and its forbidden for normal pads to include a $ in the name. From f27aacc5bffa4ac3547e57e7453be963d5588199 Mon Sep 17 00:00:00 2001 From: Stefan Date: Sat, 15 Aug 2015 22:41:59 +0200 Subject: [PATCH 2/2] Fix missing bracket --- src/node/db/API.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/db/API.js b/src/node/db/API.js index 97d5162d..a6f5cb0d 100644 --- a/src/node/db/API.js +++ b/src/node/db/API.js @@ -499,7 +499,7 @@ appendChatMessage(padID, text, authorID, time), creates a chat message for the p Example returns: -{code: 0, message:"ok", data: null +{code: 0, message:"ok", data: null} {code: 1, message:"padID does not exist", data: null} */ exports.appendChatMessage = function(padID, text, authorID, time, callback)