channel.js 733 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. var channel = function(){
  2. this.name = null;
  3. this.TS = null;
  4. this.topic = null;
  5. this.modes = {};
  6. this.users = [];
  7. this.setTS = function(TS){
  8. this.TS = TS;
  9. };
  10. this.addModes = function(modes, args){
  11. // TODO
  12. };
  13. this.joinUser = function(user){
  14. if(this.users.indexOf(user) >= 0) return;
  15. this.users.push(user);
  16. };
  17. this.setStatusModes = function(user, modes){
  18. // TODO
  19. };
  20. this.addBan = function(ban){
  21. // TODO
  22. };
  23. this.addExcept = function(except){
  24. // TODO
  25. };
  26. this.addInvex = function(invex){
  27. // TODO
  28. };
  29. this.removeUser = function(user){
  30. for(var i=0; i<this.users.length; i++){
  31. if(this.users[i] == user){
  32. this.users.splice(i, 1);
  33. break;
  34. }
  35. }
  36. };
  37. }
  38. module.exports = channel;