diff --git a/client/js/chat.js b/client/js/chat.js index 00ceec4..ba29c14 100644 --- a/client/js/chat.js +++ b/client/js/chat.js @@ -221,8 +221,8 @@ $(function() { .closest(".window") .data("id"); - // Remove modes - var name = user.html().replace(/[\s+@]/g, ""); + // Strip modes. + var name = user.html().trim().replace(/[+%@~]/, ""); if (name.match(/[#.]|-!-/) != null) { return; } diff --git a/lib/models/chan.js b/lib/models/chan.js index ea17f2f..907fd4b 100644 --- a/lib/models/chan.js +++ b/lib/models/chan.js @@ -19,7 +19,12 @@ Chan.prototype.sortUsers = function() { this.users, function(u) { return u.name.toLowerCase(); } ); - var modes = ["+", "@"]; + var modes = [ + "~", + "%", + "@", + "+", + ].reverse(); modes.forEach(function(mode) { this.users = _.remove( this.users,