]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/modules/extra/m_sqlutils.h
kick_channel -> chanrec::KickUser(), server_kick_channel -> chanrec::ServerKickUser()
[user/henk/code/inspircd.git] / src / modules / extra / m_sqlutils.h
1 #ifndef INSPIRCD_SQLUTILS
2 #define INSPIRCD_SQLUTILS
3
4 #include "modules.h"
5
6 #define SQLUTILAU "SQLutil AssociateUser"
7 #define SQLUTILAC "SQLutil AssociateChan"
8 #define SQLUTILUA "SQLutil UnAssociate"
9 #define SQLUTILGU "SQLutil GetAssocUser"
10 #define SQLUTILGC "SQLutil GetAssocChan"
11 #define SQLUTILSUCCESS "You shouldn't be reading this (success)"
12
13 class AssociateUser : public Request
14 {
15 public:
16         unsigned long id;
17         userrec* user;
18         
19         AssociateUser(Module* s, Module* d, unsigned long i, userrec* u)
20         : Request(s, d, SQLUTILAU), id(i), user(u)
21         {
22         }
23         
24         AssociateUser& S()
25         {
26                 Send();
27                 return *this;
28         }
29 };
30
31 class AssociateChan : public Request
32 {
33 public:
34         unsigned long id;
35         chanrec* chan;
36         
37         AssociateChan(Module* s, Module* d, unsigned long i, chanrec* u)
38         : Request(s, d, SQLUTILAC), id(i), chan(u)
39         {
40         }
41         
42         AssociateChan& S()
43         {
44                 Send();
45                 return *this;
46         }
47 };
48
49 class UnAssociate : public Request
50 {
51 public:
52         unsigned long id;
53
54         UnAssociate(Module* s, Module* d, unsigned long i)
55         : Request(s, d, SQLUTILUA), id(i)
56         {
57         }
58         
59         UnAssociate& S()
60         {
61                 Send();
62                 return *this;
63         }
64 };
65
66 class GetAssocUser : public Request
67 {
68 public:
69         unsigned long id;
70         userrec* user;
71
72         GetAssocUser(Module* s, Module* d, unsigned long i)
73         : Request(s, d, SQLUTILGU), id(i), user(NULL)
74         {
75         }
76         
77         GetAssocUser& S()
78         {
79                 Send();
80                 return *this;
81         }
82 };
83
84 class GetAssocChan : public Request
85 {
86 public:
87         unsigned long id;
88         chanrec* chan;
89
90         GetAssocChan(Module* s, Module* d, unsigned long i)
91         : Request(s, d, SQLUTILGC), id(i), chan(NULL)
92         {
93         }
94         
95         GetAssocChan& S()
96         {
97                 Send();
98                 return *this;
99         }
100 };
101
102 #endif