Add permission for #402; fix a strange jwplayer issue
This commit is contained in:
parent
71114b0060
commit
2b60ab8e10
7 changed files with 116 additions and 36 deletions
|
|
@ -27,6 +27,7 @@ const DEFAULT_PERMISSIONS = {
|
|||
pollvote: -1, // Vote in polls
|
||||
viewhiddenpoll: 1.5, // View results of hidden polls
|
||||
voteskip: -1, // Vote to skip the current video
|
||||
viewvoteskip: 1.5, // View voteskip results
|
||||
mute: 1.5, // Mute other users
|
||||
kick: 1.5, // Kick other users
|
||||
ban: 2, // Ban other users
|
||||
|
|
@ -253,6 +254,10 @@ PermissionsModule.prototype.canVoteskip = function (account) {
|
|||
return this.hasPermission(account, "voteskip");
|
||||
};
|
||||
|
||||
PermissionsModule.prototype.canSeeVoteskipResults = function (actor) {
|
||||
return this.hasPermission(actor, "viewvoteskip");
|
||||
};
|
||||
|
||||
PermissionsModule.prototype.canMute = function (actor) {
|
||||
return this.hasPermission(actor, "mute");
|
||||
};
|
||||
|
|
@ -363,6 +368,7 @@ PermissionsModule.prototype.loadUnregistered = function () {
|
|||
pollvote: -1, // Vote in polls
|
||||
viewhiddenpoll: 1.5, // View results of hidden polls
|
||||
voteskip: -1, // Vote to skip the current video
|
||||
viewvoteskip: 1.5, // View voteskip results
|
||||
playlistlock: 2, // Lock/unlock the playlist
|
||||
leaderctl: 0, // Give/take leader
|
||||
drink: 0, // Use the /d command
|
||||
|
|
|
|||
|
|
@ -93,8 +93,10 @@ VoteskipModule.prototype.sendVoteskipData = function (users) {
|
|||
: 0
|
||||
};
|
||||
|
||||
var perms = this.channel.modules.permissions;
|
||||
|
||||
users.forEach(function (u) {
|
||||
if (u.account.effectiveRank >= 1.5) {
|
||||
if (perms.canSeeVoteskipResults(u)) {
|
||||
u.socket.emit("voteskip", data);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue