mirror of https://github.com/calzoneman/sync.git
Add permission for chat
This commit is contained in:
parent
d363b1560e
commit
59df3924f8
|
@ -68,7 +68,8 @@ var Channel = function(name) {
|
|||
ban: 2,
|
||||
motdedit: 3,
|
||||
filteredit: 3,
|
||||
drink: 1.5
|
||||
drink: 1.5,
|
||||
chat: 0
|
||||
};
|
||||
this.opts = {
|
||||
allow_voteskip: true,
|
||||
|
@ -1710,7 +1711,10 @@ Channel.prototype.tryChat = function(user, data) {
|
|||
return;
|
||||
}
|
||||
|
||||
if(data.msg == undefined) {
|
||||
if(!this.hasPermission(user, "chat"))
|
||||
return;
|
||||
|
||||
if(typeof data.msg !== "string") {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -762,6 +762,8 @@ function handlePermissionChange() {
|
|||
for(var i = 0; i < users.length; i++) {
|
||||
addUserDropdown($(users[i]), users[i].children[1].innerHTML);
|
||||
}
|
||||
|
||||
$("#chatline").attr("disabled", !hasPermission("chat"));
|
||||
rebuildPlaylist();
|
||||
}
|
||||
|
||||
|
@ -1195,6 +1197,7 @@ function genPermissionsEditor() {
|
|||
|
||||
addDivider("Misc");
|
||||
makeOption("Drink calls", "drink", modleader, CHANNEL.perms.drink+"");
|
||||
makeOption("Chat", "chat", standard, CHANNEL.perms.chat+"");
|
||||
|
||||
var submit = $("<button/>").addClass("btn btn-primary").appendTo(fs);
|
||||
submit.text("Save");
|
||||
|
|
Loading…
Reference in New Issue