User:Ultimate Dark Carnage/chat.js

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

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; return Array.prototype.map.call(this.users, function(user, index){       if (String(void 0) == typeof user) return;        var userdata = mainRoom.model.users.findByName(user),            userdataObj = {                groups: userdata.attributes.groups,                inGroup: function(groups){                    var bool = null;                    switch (typeof groups){                        case 'object':                            if (groups instanceof Array === false) return;                            bool = Array.prototype.every.call(groups, function(group, index){ let _groups = userdata.attributes.groups; return (_groups.indexOf(group) === -1) ? false : true; });                           break;                        case 'string':                            if (groups === '') return;                            let _groups = userdata.attributes.groups;                            bool = (_groups.indexOf(group) === -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.editCount,                isAFK: userdata.attributes.statusState === 'away',                isHere: userdata.attributes.statusState === 'here', since: userdata.attributes.since };       return userdataObj; }); };