User:Ultimate Dark Carnage/chat.js

var UserList = (document.defaultView || window).UserList || function{ if (String(void 0) == typeof this.users) this._get; this.length = this.users.length; return this; };

UserList.prototype._get = function{ var user_list = []; mainRoom.model.users.forEach(function(child){       var name = child.attributes.name;        if (user_list.indexOf(name) === -1)            user_list[user_list.length] = name;    }); this.users = user_list.sort; };

UserList.prototype._getUserData = function{ this.users = this.users || []; this.users = this.users.sort; var userdataObj = {}; Array.prototype.forEach.call(this.users, function(user, index){       if (String(void 0) == typeof user) return;        var userdata = mainRoom.model.users.findByName(user);        userdataObj[user] = {                groups: userdata.attributes.groups,                inGroup: function(groups){                    var bool = null;                    switch (typeof groups){                        case 'object':                            if (groups instanceof Array === false) return;                            for (let i = 0; i < groups.length; i++){                                let group = groups[i],                                    _groups = userdata.attributes.groups;                                bool = false;                                if (_groups.indexOf(group) > -1){                                    bool = true;                                    break;                                } }                           break; case 'string': if (groups === '') return; let _groups = userdata.attributes.groups; bool = (_groups.indexOf(groups) === -1) ? false : true; break; default: return; }                   return bool; },               avatar: userdata.attributes.avatarSrc, statusState: userdata.attributes.statusState, name: userdata.attributes.name, active: userdata.attributes.active, //editCount: userdata.attributes.editCount, //editcount: userdataObj[user].editCount, isAFK: userdata.attributes.statusState === 'away', isHere: userdata.attributes.statusState === 'here', since: userdata.attributes.since };   });    return userdataObj; };