1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
7 * <brain@chatspike.net>
8 * <Craig@chatspike.net>
10 * Written by Craig Edwards, Craig McLure, and others.
11 * This program is free but copyrighted software; see
12 * the file COPYING for details.
14 * ---------------------------------------------------
20 // include the common header files
44 MODEACTION_DENY = 0, /* Drop the mode change, AND a parameter if its a parameterized mode */
45 MODEACTION_ALLOW = 1 /* Allow the mode */
54 ModeOutput(std::string parameter, ModeAction action);
55 ModeAction GetAction();
56 std::string& GetParameter();
68 ModeHandler(char modeletter, int parameters, bool listmode, ModeType type, bool operonly);
69 virtual ~ModeHandler();
72 ModeType GetModeType();
77 virtual ModeOutput OnModeChange(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter, bool adding);
78 virtual void DisplayList(userrec* user, chanrec* channel);
79 virtual bool CheckTimeStamp(time_t theirs, time_t ours, const std::string &their_param, const std::string &our_param, chanrec* channel);
88 ModeWatcher(char modeletter, ModeType type);
89 virtual ~ModeWatcher();
92 ModeType GetModeType();
94 virtual bool BeforeMode(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter, bool adding);
95 virtual void AfterMode(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter, bool adding);
101 char* GiveOps(userrec *user,char *dest,chanrec *chan,int status);
102 char* GiveHops(userrec *user,char *dest,chanrec *chan,int status);
103 char* GiveVoice(userrec *user,char *dest,chanrec *chan,int status);
104 char* TakeOps(userrec *user,char *dest,chanrec *chan,int status);
105 char* TakeHops(userrec *user,char *dest,chanrec *chan,int status);
106 char* TakeVoice(userrec *user,char *dest,chanrec *chan,int status);
107 char* AddBan(userrec *user,char *dest,chanrec *chan,int status);
108 char* TakeBan(userrec *user,char *dest,chanrec *chan,int status);
109 userrec* SanityChecks(userrec *user,char *dest,chanrec *chan,int status);
110 char* Grant(userrec *d,chanrec *chan,int MASK);
111 char* Revoke(userrec *d,chanrec *chan,int MASK);
113 std::string CompressModes(std::string modes,bool channelmodes);
114 void ProcessModes(char **parameters,userrec* user,chanrec *chan,int status, int pcnt, bool servermode, bool silent, bool local);
115 bool AllowedUmode(char umode, char* sourcemodes,bool adding,bool serveroverride);
116 bool ProcessModuleUmode(char umode, userrec* source, void* dest, bool adding);
117 void ServerMode(char **parameters, int pcnt, userrec *user);
120 class cmd_mode : public command_t
123 cmd_mode () : command_t("MODE",0,1) { }
124 void Handle(char **parameters, int pcnt, userrec *user);