|
|
|
@ -908,13 +908,13 @@ module.exports.create = function (cfg, cb) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// unauthenticated RPC calls have a different message format
|
|
|
|
|
if (msg[0] === "WRITE_PRIVATE_MESSAGE" && output && output.channel) {
|
|
|
|
|
if (msg[0] === "WRITE_PRIVATE_MESSAGE" && Array.isArray(output) && output[1] && output[1].channel) {
|
|
|
|
|
// clients don't validate messages sent by the historyKeeper
|
|
|
|
|
// so this broadcast needs to come from a different id
|
|
|
|
|
// we pass 'null' to indicate that it's not coming from a real user
|
|
|
|
|
// to ensure that they know not to trust this message
|
|
|
|
|
Server.getChannelUserList(output.channel).forEach(function (userId) {
|
|
|
|
|
Server.send(userId, output.message);
|
|
|
|
|
Server.getChannelUserList(output[1].channel).forEach(function (userId) {
|
|
|
|
|
Server.send(userId, output[1].message);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// rpc and anonRpc expect their responses to be of a certain length
|
|
|
|
|