Delint
This commit is contained in:
parent
9a4075c637
commit
83221da7d7
1 changed files with 10 additions and 10 deletions
|
@ -131,15 +131,15 @@ function textForRoomNameEvent(ev) {
|
||||||
|
|
||||||
function textForServerACLEvent(ev) {
|
function textForServerACLEvent(ev) {
|
||||||
const senderDisplayName = ev.sender && ev.sender.name ? ev.sender.name : ev.getSender();
|
const senderDisplayName = ev.sender && ev.sender.name ? ev.sender.name : ev.getSender();
|
||||||
const prev_content = ev.getPrevContent();
|
const prevContent = ev.getPrevContent();
|
||||||
const changes = [];
|
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 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) {
|
if (prev.deny.length === 0 && prev.allow.length === 0) {
|
||||||
text = `${senderDisplayName} set server ACLs for this room: `;
|
text = `${senderDisplayName} set server ACLs for this room: `;
|
||||||
} else {
|
} else {
|
||||||
|
@ -151,11 +151,11 @@ function textForServerACLEvent(ev) {
|
||||||
return text + "🎉 All servers are banned from participating! This room can no longer be used.";
|
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 = [];
|
current.allow = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Array.isArray(current.deny)){
|
if (!Array.isArray(current.deny)) {
|
||||||
current.deny = [];
|
current.deny = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue