From 3d4fb8179689c581e6f01c626d7d364a9e7d43b7 Mon Sep 17 00:00:00 2001 From: Mark Holmquist Date: Wed, 8 Aug 2012 10:12:11 -0700 Subject: [PATCH] Add in an HTTP API call to send a custom message type. You cannot currently send any data with your custom message, but this patch is just begging for a second one that will allow that. --- src/node/db/API.js | 33 +++++++++++++++++++++++++++ src/node/handler/APIHandler.js | 3 ++- src/node/handler/PadMessageHandler.js | 22 ++++++++++++++++++ 3 files changed, 57 insertions(+), 1 deletion(-) diff --git a/src/node/db/API.js b/src/node/db/API.js index 4a1371ba5..64ddef68b 100644 --- a/src/node/db/API.js +++ b/src/node/db/API.js @@ -512,6 +512,39 @@ exports.listAuthorsOfPad = function(padID, callback) }); } +/** +sendClientsMessage(padID, msg) sends a message to all clients connected to the +pad, possibly for the purpose of signalling a plugin. + +Note, this will only accept strings from the HTTP API, so sending bogus changes +or chat messages will probably not be possible. + +The resulting message will be structured like so: + +{ + type: 'COLLABROOM', + data: { + type: , + time: