Currently Playing:
-diff --git a/api.js b/api.js
index 1c8889e3..226c2e68 100644
--- a/api.js
+++ b/api.js
@@ -110,6 +110,15 @@ function handleChannelData(params, req, res) {
}
function handleChannelList(params, req, res) {
+ if(params.filter == "public") {
+ var clist = [];
+ for(var key in Server.channels) {
+ if(Server.channels[key].opts.show_public) {
+ clist.push(key);
+ }
+ }
+ handleChannelData({channel: clist.join(",")}, req, res);
+ }
var session = params.session || "";
var name = params.name || "";
var pw = params.pw || "";
diff --git a/channel.js b/channel.js
index f9a38935..3cc84308 100644
--- a/channel.js
+++ b/channel.js
@@ -50,7 +50,8 @@ var Channel = function(name) {
pagetitle: this.name,
customcss: "",
customjs: "",
- chat_antiflood: false
+ chat_antiflood: false,
+ show_public: false
};
this.filters = [
new Filter("monospace", "`([^`]+)`", "g", "$1
"),
@@ -1147,9 +1148,10 @@ Channel.prototype.tryUpdateOptions = function(user, data) {
}
const adminonly = {
- opt_pagetitle: true,
- opt_customcss: true,
- opt_customjs: true
+ pagetitle: true,
+ customcss: true,
+ customjs: true,
+ show_public: true
};
for(var key in this.opts) {
diff --git a/www/assets/js/callbacks.js b/www/assets/js/callbacks.js
index fab34aca..442fa9cf 100644
--- a/www/assets/js/callbacks.js
+++ b/www/assets/js/callbacks.js
@@ -77,6 +77,7 @@ function initCallbacks() {
$("#opt_customcss").val(opts.customcss);
$("#opt_customjs").val(opts.customjs);
$("#opt_chat_antiflood").prop("checked", opts.chat_antiflood);
+ $("#opt_show_public").prop("checked", opts.show_public);
$("#customCss").remove();
if(opts.customcss.trim() != "") {
$("").attr("rel", "stylesheet")
diff --git a/www/assets/js/client.js b/www/assets/js/client.js
index b851ff51..3397c423 100644
--- a/www/assets/js/client.js
+++ b/www/assets/js/client.js
@@ -376,7 +376,8 @@ $("#opt_submit").click(function() {
pagetitle: ptitle,
customcss: css,
customjs: $("#opt_customjs").val(),
- chat_antiflood: $("#opt_chat_antiflood").prop("checked")
+ chat_antiflood: $("#opt_chat_antiflood").prop("checked"),
+ show_public: $("#opt_show_public").prop("checked")
};
socket.emit("channelOpts", opts);
});
diff --git a/www/assets/js/functions.js b/www/assets/js/functions.js
index 2460c626..a56cb889 100644
--- a/www/assets/js/functions.js
+++ b/www/assets/js/functions.js
@@ -827,6 +827,7 @@ function handleRankChange() {
$("#opt_pagetitle").attr("disabled", val);
$("#opt_customcss").attr("disabled", val);
$("#opt_customjs").attr("disabled", val);
+ $("#opt_show_public").attr("disabled", val);
$("#show_filtereditor").attr("disabled", val);
$("#show_acl").attr("disabled", val);
}
diff --git a/www/channel.html b/www/channel.html
index 920e77a5..13cf09c2 100644
--- a/www/channel.html
+++ b/www/channel.html
@@ -196,6 +196,11 @@
Prevent chat flood
+
+
Currently Playing:
-