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

@@ -43,6 +43,7 @@ define([
var sframeChan = common.getSframeChannel();
var metadataMgr = common.getMetadataMgr();
var origin = metadataMgr.getPrivateData().origin;
var readOnly = metadataMgr.getPrivateData().readOnly;
var isApp = typeof(toolbar) !== "undefined";
@@ -358,7 +359,7 @@ define([
}, function (e) {
if (e) {
// failed to send
return void console.error('failed to send');
return void console.error('failed to send', e);
}
input.value = '';
sending = false;
@@ -406,9 +407,9 @@ define([
'data-user': data.isFriendChat && curvePublic
}, [
header,
tips,
readOnly ? undefined : tips,
messages,
h('div.cp-app-contacts-input', [
readOnly ? undefined : h('div.cp-app-contacts-input', [
input,
sendButton,
]),