123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- var channel = function(){
- this.name = null;
- this.TS = null;
- this.topic = null;
- this.modes = {};
- this.statusModes = {};
- this.users = [];
- this.setTS = function(TS){
- this.TS = TS;
- };
-
- this.addModes = function(modes){
- console.log(modes);
- // TODO
- };
-
- this.joinUser = function(user){
- if(this.users.indexOf(user) >= 0) return;
- this.users.push(user);
- };
-
- this.setStatusModes = function(user, modes){
- console.log(user);
- console.log(modes);
- this.statusModes[user.uid] = modes;
- // TODO
- };
-
- this.addBan = function(ban){
- // TODO
- };
-
- this.addExcept = function(except){
- // TODO
- };
-
- this.addInvex = function(invex){
- // TODO
- };
-
- this.removeUser = function(user){
- var index = this.statusModes.indexOf(user);
- if(index >= 0){
- this.statusModes.splice(index, 1); // remove status modes for this user
- }
- for(var i=0; i<this.users.length; i++){
- if(this.users[i] == user){
- this.users.splice(i, 1);
- break;
- }
- }
- };
- }
- module.exports = channel;
|