]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - docs/man/chanrec.3
Added module sockets to new engine, MAY NOT WORK
[user/henk/code/inspircd.git] / docs / man / chanrec.3
1 .TH "chanrec" 3 "30 Apr 2004" "InspIRCd" \" -*- nroff -*-
2 .ad l
3 .nh
4 .SH NAME
5 chanrec \- Holds all relevent information for a channel. 
6
7 .PP
8 .SH SYNOPSIS
9 .br
10 .PP
11 \fC#include <channels.h>\fP
12 .PP
13 Inherits \fBExtensible\fP.
14 .PP
15 .SS "Public Member Functions"
16
17 .in +1c
18 .ti -1c
19 .RI "void \fBSetCustomMode\fP (char mode, bool mode_on)"
20 .br
21 .RI "\fISets or unsets a custom mode in the channels info.\fP"
22 .ti -1c
23 .RI "void \fBSetCustomModeParam\fP (char mode, char *parameter, bool mode_on)"
24 .br
25 .RI "\fISets or unsets the parameters for a custom mode in a channels info.\fP"
26 .ti -1c
27 .RI "bool \fBIsCustomModeSet\fP (char mode)"
28 .br
29 .RI "\fIReturns true if a custom mode is set on a channel.\fP"
30 .ti -1c
31 .RI "std::string \fBGetModeParameter\fP (char mode)"
32 .br
33 .RI "\fIReturns the parameter for a custom mode on a channel.\fP"
34 .ti -1c
35 .RI "\fBchanrec\fP ()"
36 .br
37 .RI "\fICreates a channel record and initialises it with default values.\fP"
38 .ti -1c
39 .RI "virtual \fB~chanrec\fP ()"
40 .br
41 .in -1c
42 .SS "Public Attributes"
43
44 .in +1c
45 .ti -1c
46 .RI "char \fBname\fP [CHANMAX]"
47 .br
48 .RI "\fIThe channels name.\fP"
49 .ti -1c
50 .RI "char \fBcustom_modes\fP [MAXMODES]"
51 .br
52 .RI "\fICustom modes for the channel.\fP"
53 .ti -1c
54 .RI "char \fBtopic\fP [MAXBUF]"
55 .br
56 .RI "\fIChannel topic.\fP"
57 .ti -1c
58 .RI "time_t \fBcreated\fP"
59 .br
60 .RI "\fICreation time.\fP"
61 .ti -1c
62 .RI "time_t \fBtopicset\fP"
63 .br
64 .RI "\fITime topic was set.\fP"
65 .ti -1c
66 .RI "char \fBsetby\fP [NICKMAX]"
67 .br
68 .RI "\fIThe last user to set the topic.\fP"
69 .ti -1c
70 .RI "long \fBlimit\fP"
71 .br
72 .RI "\fIContains the channel user limit.\fP"
73 .ti -1c
74 .RI "char \fBkey\fP [32]"
75 .br
76 .RI "\fIContains the channel key.\fP"
77 .ti -1c
78 .RI "short int \fBtopiclock\fP"
79 .br
80 .RI "\fINonzero if the mode +t is set.\fP"
81 .ti -1c
82 .RI "short int \fBnoexternal\fP"
83 .br
84 .RI "\fINonzero if the mode +n is set.\fP"
85 .ti -1c
86 .RI "short int \fBinviteonly\fP"
87 .br
88 .RI "\fINonzero if the mode +i is set.\fP"
89 .ti -1c
90 .RI "short int \fBmoderated\fP"
91 .br
92 .RI "\fINonzero if the mode +m is set.\fP"
93 .ti -1c
94 .RI "short int \fBsecret\fP"
95 .br
96 .RI "\fINonzero if the mode +s is set.\fP"
97 .ti -1c
98 .RI "short int \fBc_private\fP"
99 .br
100 .RI "\fINonzero if the mode +p is set.\fP"
101 .ti -1c
102 .RI "\fBBanList\fP \fBbans\fP"
103 .br
104 .RI "\fIThe list of all bans set on the channel.\fP"
105 .in -1c
106 .SH "Detailed Description"
107 .PP 
108 Holds all relevent information for a channel.
109
110 This class represents a channel, and contains its name, modes, time created, topic, topic set time, etc, and an instance of the BanList type. 
111 .PP
112 Definition at line 83 of file channels.h.
113 .SH "Constructor & Destructor Documentation"
114 .PP 
115 .SS "chanrec::chanrec ()"
116 .PP
117 Creates a channel record and initialises it with default values.Definition at line 12 of file channels.cpp.
118 .PP
119 References c_private, created, inviteonly, limit, moderated, noexternal, secret, topiclock, and topicset.
120 .PP
121 .nf
122 13 {
123 14         strcpy(name,'');
124 15         strcpy(custom_modes,'');
125 16         strcpy(topic,'');
126 17         strcpy(setby,'');
127 18         strcpy(key,'');
128 19         created = topicset = limit = 0;
129 20         topiclock = noexternal = inviteonly = moderated = secret = c_private = false;
130 21 }
131 .fi
132 .SS "virtual chanrec::~chanrec ()\fC [inline, virtual]\fP"
133 .PP
134 Definition at line 174 of file channels.h.
135 .PP
136 .nf
137 174 { /* stub */ }
138 .fi
139 .SH "Member Function Documentation"
140 .PP 
141 .SS "std::string chanrec::GetModeParameter (char mode)"
142 .PP
143 Returns the parameter for a custom mode on a channel.For example if '+L #foo' is set, and you pass this method 'L', it will return '#foo'. If the mode is not set on the channel, or the mode has no parameters associated with it, it will return an empty string.Definition at line 87 of file channels.cpp.
144 .PP
145 References custom_mode_params.
146 .PP
147 .nf
148 88 {
149 89         if (custom_mode_params.size())
150 90         {
151 91                 for (vector<ModeParameter>::iterator i = custom_mode_params.begin(); i < custom_mode_params.end(); i++)
152 92                 {
153 93                         if ((i->mode == mode) && (!strcasecmp(this->name,i->channel)))
154 94                         {
155 95                                 return std::string(i->parameter);
156 96                         }
157 97                 }
158 98         }
159 99         return std::string('');
160 100 }
161 .fi
162 .SS "bool chanrec::IsCustomModeSet (char mode)"
163 .PP
164 Returns true if a custom mode is set on a channel.Definition at line 81 of file channels.cpp.
165 .PP
166 .nf
167 82 {
168 83         log(DEBUG,'Checking ISCustomModeSet: %c %s',mode,this->custom_modes);
169 84         return (strchr(this->custom_modes,mode) != 0);
170 85 }
171 .fi
172 .SS "void chanrec::SetCustomMode (char mode, bool mode_on)"
173 .PP
174 Sets or unsets a custom mode in the channels info.Definition at line 23 of file channels.cpp.
175 .PP
176 References custom_modes, and SetCustomModeParam().
177 .PP
178 .nf
179 24 {
180 25         if (mode_on) {
181 26                 char m[3];
182 27                 m[0] = mode;
183 28                 m[1] = '\0';
184 29                 if (!strchr(this->custom_modes,mode))
185 30                 {
186 31                         strncat(custom_modes,m,MAXMODES);
187 32                 }
188 33                 log(DEBUG,'Custom mode %c set',mode);
189 34         }
190 35         else {
191 36                 char temp[MAXBUF];
192 37                 int count = 0;
193 38                 for (int q = 0; q < strlen(custom_modes); q++) {
194 39                         if (custom_modes[q] != mode) {
195 40                                 temp[count++] = mode;
196 41                         }
197 42                 }
198 43                 temp[count] = '\0';
199 44                 strncpy(custom_modes,temp,MAXMODES);
200 45                 log(DEBUG,'Custom mode %c removed',mode);
201 46                 this->SetCustomModeParam(mode,'',false);
202 47         }
203 48 }
204 .fi
205 .SS "void chanrec::SetCustomModeParam (char mode, char * parameter, bool mode_on)"
206 .PP
207 Sets or unsets the parameters for a custom mode in a channels info.Definition at line 50 of file channels.cpp.
208 .PP
209 References ModeParameter::channel, custom_mode_params, ModeParameter::mode, and ModeParameter::parameter.
210 .PP
211 Referenced by SetCustomMode().
212 .PP
213 .nf
214 51 {
215 52 
216 53         log(DEBUG,'SetCustomModeParam called');
217 54         ModeParameter M;
218 55         M.mode = mode;
219 56         strcpy(M.channel,this->name);
220 57         strcpy(M.parameter,parameter);
221 58         if (mode_on)
222 59         {
223 60                 log(DEBUG,'Custom mode parameter %c %s added',mode,parameter);
224 61                 custom_mode_params.push_back(M);
225 62         }
226 63         else
227 64         {
228 65                 if (custom_mode_params.size())
229 66                 {
230 67                         for (vector<ModeParameter>::iterator i = custom_mode_params.begin(); i < custom_mode_params.end(); i++)
231 68                         {
232 69                                 if ((i->mode == mode) && (!strcasecmp(this->name,i->channel)))
233 70                                 {
234 71                                         log(DEBUG,'Custom mode parameter %c %s removed',mode,parameter);
235 72                                         custom_mode_params.erase(i);
236 73                                         return;
237 74                                 }
238 75                         }
239 76                 }
240 77                 log(DEBUG,'*** BUG *** Attempt to remove non-existent mode parameter!');
241 78         }
242 79 }
243 .fi
244 .SH "Member Data Documentation"
245 .PP 
246 .SS "\fBBanList\fP chanrec::bans"
247 .PP
248 The list of all bans set on the channel.Definition at line 148 of file channels.h.
249 .SS "short int chanrec::c_private"
250 .PP
251 Nonzero if the mode +p is set.This value cannot be set at the same time as \fBchanrec::secret\fPDefinition at line 144 of file channels.h.
252 .PP
253 Referenced by chanrec().
254 .SS "time_t chanrec::created"
255 .PP
256 Creation time.Definition at line 100 of file channels.h.
257 .PP
258 Referenced by chanrec().
259 .SS "char chanrec::custom_modes[MAXMODES]"
260 .PP
261 Custom modes for the channel.Plugins may use this field in any way they see fit.Definition at line 92 of file channels.h.
262 .PP
263 Referenced by SetCustomMode().
264 .SS "short int chanrec::inviteonly"
265 .PP
266 Nonzero if the mode +i is set.Definition at line 130 of file channels.h.
267 .PP
268 Referenced by chanrec().
269 .SS "char chanrec::key[32]"
270 .PP
271 Contains the channel key.If this value is an empty string, there is no channel key in place.Definition at line 118 of file channels.h.
272 .SS "long chanrec::limit"
273 .PP
274 Contains the channel user limit.If this value is zero, there is no limit in place.Definition at line 113 of file channels.h.
275 .PP
276 Referenced by chanrec().
277 .SS "short int chanrec::moderated"
278 .PP
279 Nonzero if the mode +m is set.Definition at line 134 of file channels.h.
280 .PP
281 Referenced by chanrec().
282 .SS "char chanrec::name[CHANMAX]"
283 .PP
284 The channels name.Definition at line 88 of file channels.h.
285 .SS "short int chanrec::noexternal"
286 .PP
287 Nonzero if the mode +n is set.Definition at line 126 of file channels.h.
288 .PP
289 Referenced by chanrec().
290 .SS "short int chanrec::secret"
291 .PP
292 Nonzero if the mode +s is set.This value cannot be set at the same time as \fBchanrec::c_private\fPDefinition at line 139 of file channels.h.
293 .PP
294 Referenced by chanrec().
295 .SS "char chanrec::setby[NICKMAX]"
296 .PP
297 The last user to set the topic.If this member is an empty string, no topic was ever set.Definition at line 108 of file channels.h.
298 .SS "char chanrec::topic[MAXBUF]"
299 .PP
300 Channel topic.If this is an empty string, no channel topic is set.Definition at line 97 of file channels.h.
301 .SS "short int chanrec::topiclock"
302 .PP
303 Nonzero if the mode +t is set.Definition at line 122 of file channels.h.
304 .PP
305 Referenced by chanrec().
306 .SS "time_t chanrec::topicset"
307 .PP
308 Time topic was set.If no topic was ever set, this will be equal to \fBchanrec::created\fPDefinition at line 104 of file channels.h.
309 .PP
310 Referenced by chanrec().
311
312 .SH "Author"
313 .PP 
314 Generated automatically by Doxygen for InspIRCd from the source code.