Restrict sending messages in a pad chat to editors only
This commit is contained in:
@@ -995,6 +995,9 @@ define([
|
||||
var conf = {
|
||||
onReady: function (padData) {
|
||||
channel.data = padData || {};
|
||||
if (padData && padData.validateKey && store.messenger) {
|
||||
store.messenger.storeValidateKey(data.channel, padData.validateKey);
|
||||
}
|
||||
postMessage(clientId, "PAD_READY");
|
||||
},
|
||||
onMessage: function (user, m, validateKey, isCp) {
|
||||
|
||||
@@ -107,7 +107,6 @@ define([
|
||||
}
|
||||
|
||||
|
||||
chan.encryptor = Crypto.createEncryptor(secret.keys);
|
||||
if (!chan.encryptor) { chan.encryptor = Crypto.createEncryptor(secret.keys); }
|
||||
|
||||
wc.on('join', function () {
|
||||
@@ -117,7 +116,7 @@ define([
|
||||
ctx.emit('MESSAGE', {leave: true, id: peer}, chan.clients);
|
||||
});
|
||||
wc.on('message', function (cryptMsg) {
|
||||
var msg = chan.encryptor.decrypt(cryptMsg, secret.keys.validateKey);
|
||||
var msg = chan.encryptor.decrypt(cryptMsg, secret.keys && secret.keys.validateKey);
|
||||
var parsed;
|
||||
try {
|
||||
parsed = JSON.parse(msg);
|
||||
|
||||
Reference in New Issue
Block a user