00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __MODE_H
00018 #define __MODE_H
00019
00020
00021
00022 #include <typeinfo>
00023 #include <iostream>
00024 #include <string>
00025 #include <deque>
00026 #include <sstream>
00027 #include <vector>
00028 #include "users.h"
00029 #include "channels.h"
00030 #include "ctables.h"
00031
00032 class ModeParser
00033 {
00034 private:
00035 char* GiveOps(userrec *user,char *dest,chanrec *chan,int status);
00036 char* GiveHops(userrec *user,char *dest,chanrec *chan,int status);
00037 char* GiveVoice(userrec *user,char *dest,chanrec *chan,int status);
00038 char* TakeOps(userrec *user,char *dest,chanrec *chan,int status);
00039 char* TakeHops(userrec *user,char *dest,chanrec *chan,int status);
00040 char* TakeVoice(userrec *user,char *dest,chanrec *chan,int status);
00041 char* AddBan(userrec *user,char *dest,chanrec *chan,int status);
00042 char* TakeBan(userrec *user,char *dest,chanrec *chan,int status);
00043 public:
00044 std::string CompressModes(std::string modes,bool channelmodes);
00045 void ProcessModes(char **parameters,userrec* user,chanrec *chan,int status, int pcnt, bool servermode, bool silent, bool local);
00046 bool AllowedUmode(char umode, char* sourcemodes,bool adding,bool serveroverride);
00047 bool ProcessModuleUmode(char umode, userrec* source, void* dest, bool adding);
00048 void ServerMode(char **parameters, int pcnt, userrec *user);
00049 };
00050
00051 class cmd_mode : public command_t
00052 {
00053 public:
00054 cmd_mode () : command_t("MODE",0,1) { }
00055 void Handle(char **parameters, int pcnt, userrec *user);
00056 };
00057
00058 #endif