pull/21833/head
Will Hunt 2018-07-06 16:54:28 +01:00
parent 9a4075c637
commit 83221da7d7
1 changed files with 10 additions and 10 deletions

View File

@ -131,15 +131,15 @@ function textForRoomNameEvent(ev) {
function textForServerACLEvent(ev) {
const senderDisplayName = ev.sender && ev.sender.name ? ev.sender.name : ev.getSender();
const prev_content = ev.getPrevContent();
const prevContent = ev.getPrevContent();
const changes = [];
const current = ev.getContent();
const prev = {
deny: Array.isArray(prevContent.deny) ? prevContent.deny : [],
allow: Array.isArray(prevContent.allow) ? prevContent.allow : [],
allow_ip_literals: !(prevContent.allow_ip_literals === false),
};
let text = "";
let current = ev.getContent();
let prev = {
deny: Array.isArray(prev_content.deny) ? prev_content.deny : [],
allow: Array.isArray(prev_content.allow) ? prev_content.allow : [],
allow_ip_literals: !(prev_content.allow_ip_literals === false)
}
if (prev.deny.length === 0 && prev.allow.length === 0) {
text = `${senderDisplayName} set server ACLs for this room: `;
} else {
@ -151,11 +151,11 @@ function textForServerACLEvent(ev) {
return text + "🎉 All servers are banned from participating! This room can no longer be used.";
}
if (!Array.isArray(current.allow)){
if (!Array.isArray(current.allow)) {
current.allow = [];
}
if (!Array.isArray(current.deny)){
if (!Array.isArray(current.deny)) {
current.deny = [];
}