Skip to content
This repository has been archived by the owner on May 16, 2020. It is now read-only.

Commit

Permalink
chat users list: add broadcaster and vips sections to predefined grou…
Browse files Browse the repository at this point in the history
…ps order; show any unrecognized groups added in the future after moderators. (#280)
  • Loading branch information
rakslice authored and alamminsalo committed Jul 14, 2019
1 parent 127664b commit c2390ad
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/qml/irc/ViewerList.qml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,22 @@ Item {
target: Viewers
onChatterListLoaded: {
root.loading = false;
var groupOrder = ["staff", "global_mods", "admins", "moderators", "viewers"];
var standardGroupOrder = ["broadcaster", "staff", "global_mods", "admins", "moderators", "vips", "viewers"];
var extraGroupsPos = standardGroupOrder.indexOf("moderators") + 1;

var extraGroups = [];

for (var otherGroupName in chatters) {
if (standardGroupOrder.indexOf(otherGroupName) == -1) {
extraGroups.push(otherGroupName)
}
}
extraGroups.sort();

//var groupOrder = standardGroupOrder.slice();
//groupOrder.splice.apply([extraGroupsPos, 0].concat(extraGroups));
var groupOrder = standardGroupOrder.slice(0, extraGroupsPos).concat(extraGroups, standardGroupOrder.slice(extraGroupsPos));


var viewers = []
for (var j = 0; j < groupOrder.length; j++) {
Expand Down

0 comments on commit c2390ad

Please sign in to comment.