]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/mode.h
efc83b281270ad22b8568ebaf4c355e6d478045d
[user/henk/code/inspircd.git] / include / mode.h
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  Inspire is copyright (C) 2002-2005 ChatSpike-Dev.
6  *                       E-mail:
7  *                <brain@chatspike.net>
8  *                <Craig@chatspike.net>
9  *     
10  * Written by Craig Edwards, Craig McLure, and others.
11  * This program is free but copyrighted software; see
12  *            the file COPYING for details.
13  *
14  * ---------------------------------------------------
15  */
16
17 #ifndef __MODE_H
18 #define __MODE_H
19
20 // include the common header files
21
22 #include <typeinfo>
23 #include <iostream>
24 #include <string>
25 #include <deque>
26 #include <sstream>
27 #include <vector>
28 #include "users.h"
29 #include "channels.h"
30
31 class ModeParser
32 {
33  private:
34         char* GiveOps(userrec *user,char *dest,chanrec *chan,int status);
35         char* GiveHops(userrec *user,char *dest,chanrec *chan,int status);
36         char* GiveVoice(userrec *user,char *dest,chanrec *chan,int status);
37         char* TakeOps(userrec *user,char *dest,chanrec *chan,int status);
38         char* TakeHops(userrec *user,char *dest,chanrec *chan,int status);
39         char* TakeVoice(userrec *user,char *dest,chanrec *chan,int status);
40         char* AddBan(userrec *user,char *dest,chanrec *chan,int status);
41         char* TakeBan(userrec *user,char *dest,chanrec *chan,int status);
42  public:
43         std::string CompressModes(std::string modes,bool channelmodes);
44         void ProcessModes(char **parameters,userrec* user,chanrec *chan,int status, int pcnt, bool servermode, bool silent, bool local);
45         bool AllowedUmode(char umode, char* sourcemodes,bool adding,bool serveroverride);
46         bool ProcessModuleUmode(char umode, userrec* source, void* dest, bool adding);
47         void ServerMode(char **parameters, int pcnt, userrec *user);
48 };
49
50 void handle_mode(char **parameters, int pcnt, userrec *user);
51
52
53 #endif