summaryrefslogtreecommitdiff
path: root/src/node/handler/PadMessageHandler.js
diff options
context:
space:
mode:
authorStefan <mu.stefan@googlemail.com>2015-08-15 22:05:31 +0200
committerStefan <mu.stefan@googlemail.com>2015-08-15 22:05:31 +0200
commit94cb743ca8a772edde7383b0b0567eb8104817f8 (patch)
tree334894f165c8859915f4ead198c6d35a8f9b2586 /src/node/handler/PadMessageHandler.js
parent02c022aab14f9087e22cebd4123336935cc089d8 (diff)
downloadetherpad-lite-94cb743ca8a772edde7383b0b0567eb8104817f8.zip
Fix API call appendChatMessage to send new message to all connected clients
Diffstat (limited to 'src/node/handler/PadMessageHandler.js')
-rw-r--r--src/node/handler/PadMessageHandler.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/node/handler/PadMessageHandler.js b/src/node/handler/PadMessageHandler.js
index 248dc128..91fa37e4 100644
--- a/src/node/handler/PadMessageHandler.js
+++ b/src/node/handler/PadMessageHandler.js
@@ -375,6 +375,17 @@ function handleChatMessage(client, message)
var text = message.data.text;
var padId = sessioninfos[client.id].padId;
+ exports.sendChatMessageToPadClients(time, userId, text, padId);
+}
+
+/**
+ * Sends a chat message to all clients of this pad
+ * @param time the timestamp of the chat message
+ * @param userId the author id of the chat message
+ * @param text the text of the chat message
+ * @param padId the padId to send the chat message to
+ */
+exports.sendChatMessageToPadClients = function (time, userId, text, padId) {
var pad;
var userName;