Sort users
This commit is contained in:
parent
85d2ef0d39
commit
be45ab45f9
@ -21,5 +21,20 @@ function Chan(attr) {
|
||||
}
|
||||
|
||||
Chan.prototype.sortUsers = function() {
|
||||
// ..
|
||||
this.users = _.sortBy(
|
||||
this.users,
|
||||
function(u) { return u.name.toLowerCase(); }
|
||||
);
|
||||
var modes = [
|
||||
"~",
|
||||
"%",
|
||||
"@",
|
||||
"+",
|
||||
].reverse();
|
||||
modes.forEach(function(mode) {
|
||||
this.users = _.remove(
|
||||
this.users,
|
||||
function(u) { return u.mode == mode; }
|
||||
).concat(this.users);
|
||||
}, this);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user