From ddb4ad9ce46b61583917d9a5db0f9fda9f00d65f Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 16 Dec 2005 11:21:22 +0000 Subject: Moved mode stuff into modeparser git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2520 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/mode.h | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'include') diff --git a/include/mode.h b/include/mode.h index e63d9de6e..94d9666dd 100644 --- a/include/mode.h +++ b/include/mode.h @@ -28,21 +28,26 @@ #include "users.h" #include "channels.h" -char* give_ops(userrec *user,char *dest,chanrec *chan,int status); -char* give_hops(userrec *user,char *dest,chanrec *chan,int status); -char* give_voice(userrec *user,char *dest,chanrec *chan,int status); -char* take_ops(userrec *user,char *dest,chanrec *chan,int status); -char* take_hops(userrec *user,char *dest,chanrec *chan,int status); -char* take_voice(userrec *user,char *dest,chanrec *chan,int status); -char* add_ban(userrec *user,char *dest,chanrec *chan,int status); -char* take_ban(userrec *user,char *dest,chanrec *chan,int status); -void process_modes(char **parameters,userrec* user,chanrec *chan,int status, int pcnt, bool servermode, bool silent, bool local); -bool allowed_umode(char umode, char* sourcemodes,bool adding); -bool process_module_umode(char umode, userrec* source, void* dest, bool adding); +class ModeParser +{ + private: + char* GiveOps(userrec *user,char *dest,chanrec *chan,int status); + char* GiveHops(userrec *user,char *dest,chanrec *chan,int status); + char* GiveVoice(userrec *user,char *dest,chanrec *chan,int status); + char* TakeOps(userrec *user,char *dest,chanrec *chan,int status); + char* TakeHops(userrec *user,char *dest,chanrec *chan,int status); + char* TakeVoice(userrec *user,char *dest,chanrec *chan,int status); + char* AddBan(userrec *user,char *dest,chanrec *chan,int status); + char* TakeBan(userrec *user,char *dest,chanrec *chan,int status); + CompressModes(std::string modes,bool channelmodes); + public: + void ProcessModes(char **parameters,userrec* user,chanrec *chan,int status, int pcnt, bool servermode, bool silent, bool local); + bool AllowedUmode(char umode, char* sourcemodes,bool adding); + bool ProcessModuleUmode(char umode, userrec* source, void* dest, bool adding); + void ServerMode(char **parameters, int pcnt, userrec *user); +}; + void handle_mode(char **parameters, int pcnt, userrec *user); -void server_mode(char **parameters, int pcnt, userrec *user); -void merge_mode(char **parameters, int pcnt); -void merge_mode2(char **parameters, int pcnt, userrec* user); #endif -- cgit v1.2.3