diff --git a/lib/channel-new.js b/lib/channel-new.js index 496f9e63..f4417eac 100644 --- a/lib/channel-new.js +++ b/lib/channel-new.js @@ -1765,6 +1765,7 @@ Channel.prototype.deleteMedia = function (uid, callback) { self.sendAll("delete", { uid: uid }); + self.updatePlaylistMeta(); self.sendPlaylistMeta(self.users); callback(null); } else { diff --git a/www/assets/js/callbacks.js b/www/assets/js/callbacks.js index 93aa77a0..555f22e5 100644 --- a/www/assets/js/callbacks.js +++ b/www/assets/js/callbacks.js @@ -528,7 +528,7 @@ Callbacks = { return; } - user.data("meta", data); + user.data("meta", data.meta); if (data.meta.muted || data.meta.smuted) { user.data("icon", "glyphicon-volume-off"); } else { @@ -586,7 +586,7 @@ Callbacks = { }, setUserRank: function (data) { - var entries = $("#cs-chanranks table").data("entries"); + var entries = $("#cs-chanranks table").data("entries") || []; var found = false; for (var i = 0; i < entries.length; i++) { if (entries[i].name === data.name) { diff --git a/www/assets/js/util.js b/www/assets/js/util.js index 736ab86b..668e27eb 100644 --- a/www/assets/js/util.js +++ b/www/assets/js/util.js @@ -159,7 +159,8 @@ function getNameColor(rank) { function addUserDropdown(entry) { var name = entry.data("name"), rank = entry.data("rank"), - leader = entry.data("leader"); + leader = entry.data("leader"), + meta = entry.data("meta") || {}; entry.find(".user-dropdown").remove(); var menu = $("
") .addClass("user-dropdown") @@ -222,6 +223,49 @@ function addUserDropdown(entry) { .appendTo(btngroup); } + /* mute buttons */ + if (hasPermission("mute")) { + var mute = $("").addClass("btn btn-xs btn-default") + .text("Mute") + .click(function () { + socket.emit("chatMsg", { + msg: "/mute " + name + }); + mute.hide(); + smute.hide(); + unmute.show(); + }) + .appendTo(btngroup); + var smute = $("").addClass("btn btn-xs btn-default") + .text("Shadow Mute") + .click(function () { + socket.emit("chatMsg", { + msg: "/smute " + name + }); + mute.hide(); + smute.hide(); + unmute.show(); + }) + .appendTo(btngroup); + var unmute = $("").addClass("btn btn-xs btn-default") + .text("Unmute") + .click(function () { + socket.emit("chatMsg", { + msg: "/unmute " + name + }); + unmute.hide(); + mute.show(); + smute.show(); + }) + .appendTo(btngroup); + if (meta.muted) { + mute.hide(); + smute.hide(); + } else { + unmute.hide(); + } + } + /* ban buttons */ if(hasPermission("ban")) { $("").addClass("btn btn-xs btn-default")