Restrict sending messages in a pad chat to editors only

This commit is contained in:
yflory
2018-12-10 17:47:47 +01:00
parent a2e28e6e25
commit d88dee9a83
7 changed files with 59 additions and 22 deletions

View File

@@ -173,9 +173,10 @@ define([
};
funcs.openPadChat = function (saveChanges) {
var md = JSON.parse(JSON.stringify(ctx.metadataMgr.getMetadata()));
var channel = md.chat || Hash.createChannelId();
if (!md.chat) {
md.chat = channel;
if (md.chat) { delete md.chat; } // Old channel without signing key
var channel = md.chat2 || Hash.createChannelId();
if (!md.chat2) {
md.chat2 = channel;
ctx.metadataMgr.updateMetadata(md);
setTimeout(saveChanges);
}