Fix team creation

pull/1/head
yflory 5 years ago
parent 09076f39ff
commit 8afb0255c1

@ -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

Loading…
Cancel
Save