1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3 <title>InspIRCd: chanrec class Reference</title>
4 <link href="inspircd.css" rel="stylesheet" type="text/css">
6 <!-- Generated by Doxygen 1.3.3 -->
7 <div class="qindex"><a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Compound List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Compound Members</a> | <a class="qindex" href="globals.html">File Members</a></div>
8 <h1>chanrec Class Reference</h1>Holds all relevent information for a channel.
9 <a href="#_details">More...</a>
11 <code>#include <<a class="el" href="channels_8h-source.html">channels.h</a>></code>
13 Inherits <a class="el" href="classExtensible.html">Extensible</a>.
15 <a href="classchanrec-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
17 <tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
18 <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#a0">SetCustomMode</a> (char mode, bool mode_on)</td></tr>
20 <tr><td class="mdescLeft"> </td><td class="mdescRight">Sets or unsets a custom mode in the channels info. </em> <a href="#a0"></a><em><br><br></td></tr>
21 <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#a1">SetCustomModeParam</a> (char mode, char *parameter, bool mode_on)</td></tr>
23 <tr><td class="mdescLeft"> </td><td class="mdescRight">Sets or unsets the parameters for a custom mode in a channels info. </em> <a href="#a1"></a><em><br><br></td></tr>
24 <tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#a2">IsCustomModeSet</a> (char mode)</td></tr>
26 <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns true if a custom mode is set on a channel. </em> <a href="#a2"></a><em><br><br></td></tr>
27 <tr><td class="memItemLeft" nowrap align=right valign=top>std::string </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#a3">GetModeParameter</a> (char mode)</td></tr>
29 <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the parameter for a custom mode on a channel. </em> <a href="#a3"></a><em><br><br></td></tr>
30 <tr><td class="memItemLeft" nowrap align=right valign=top>long </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#a4">GetUserCounter</a> ()</td></tr>
32 <tr><td class="mdescLeft"> </td><td class="mdescRight">Obtain the channel "user counter" This returns the channel reference counter, which is initialized to 0 when the channel is created and incremented/decremented upon joins, parts quits and kicks. </em> <a href="#a4"></a><em><br><br></td></tr>
33 <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#a5">AddUser</a> (char *castuser)</td></tr>
35 <tr><td class="mdescLeft"> </td><td class="mdescRight">Add a user pointer to the internal reference list The data inserted into the reference list is a table as it is an arbitary pointer compared to other users by its memory address, as this is a very fast 32 or 64 bit integer comparison. </em> <a href="#a5"></a><em><br><br></td></tr>
36 <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#a6">DelUser</a> (char *castuser)</td></tr>
38 <tr><td class="mdescLeft"> </td><td class="mdescRight">Delete a user pointer to the internal reference list The data removed from the reference list is a table as it is an arbitary pointer compared to other users by its memory address, as this is a very fast 32 or 64 bit integer comparison. </em> <a href="#a6"></a><em><br><br></td></tr>
39 <tr><td class="memItemLeft" nowrap align=right valign=top>std::vector< char * > * </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#a7">GetUsers</a> ()</td></tr>
41 <tr><td class="mdescLeft"> </td><td class="mdescRight">Obrain the internal reference list The internal reference list contains a list of userrec* cast to char*. </em> <a href="#a7"></a><em><br><br></td></tr>
42 <tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#a8">chanrec</a> ()</td></tr>
44 <tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a channel record and initialises it with default values. </em> <a href="#a8"></a><em><br><br></td></tr>
45 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#a9">~chanrec</a> ()</td></tr>
47 <tr><td colspan=2><br><h2>Public Attributes</h2></td></tr>
48 <tr><td class="memItemLeft" nowrap align=right valign=top>char </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o0">name</a> [CHANMAX]</td></tr>
50 <tr><td class="mdescLeft"> </td><td class="mdescRight">The channels name. </em> <a href="#o0"></a><em><br><br></td></tr>
51 <tr><td class="memItemLeft" nowrap align=right valign=top>char </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o1">custom_modes</a> [MAXMODES]</td></tr>
53 <tr><td class="mdescLeft"> </td><td class="mdescRight">Custom modes for the channel. </em> <a href="#o1"></a><em><br><br></td></tr>
54 <tr><td class="memItemLeft" nowrap align=right valign=top>std::vector< char * > </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o2">internal_userlist</a></td></tr>
56 <tr><td class="mdescLeft"> </td><td class="mdescRight">User list (casted to char*'s to stop forward declaration stuff) (chicken and egg scenario!). </em> <a href="#o2"></a><em><br><br></td></tr>
57 <tr><td class="memItemLeft" nowrap align=right valign=top>char </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o3">topic</a> [MAXBUF]</td></tr>
59 <tr><td class="mdescLeft"> </td><td class="mdescRight">Channel topic. </em> <a href="#o3"></a><em><br><br></td></tr>
60 <tr><td class="memItemLeft" nowrap align=right valign=top>time_t </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o4">created</a></td></tr>
62 <tr><td class="mdescLeft"> </td><td class="mdescRight">Creation time. </em> <a href="#o4"></a><em><br><br></td></tr>
63 <tr><td class="memItemLeft" nowrap align=right valign=top>time_t </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o5">topicset</a></td></tr>
65 <tr><td class="mdescLeft"> </td><td class="mdescRight">Time topic was set. </em> <a href="#o5"></a><em><br><br></td></tr>
66 <tr><td class="memItemLeft" nowrap align=right valign=top>char </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o6">setby</a> [NICKMAX]</td></tr>
68 <tr><td class="mdescLeft"> </td><td class="mdescRight">The last user to set the topic. </em> <a href="#o6"></a><em><br><br></td></tr>
69 <tr><td class="memItemLeft" nowrap align=right valign=top>short int </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o7">limit</a></td></tr>
71 <tr><td class="mdescLeft"> </td><td class="mdescRight">Contains the channel user limit. </em> <a href="#o7"></a><em><br><br></td></tr>
72 <tr><td class="memItemLeft" nowrap align=right valign=top>char </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o8">key</a> [32]</td></tr>
74 <tr><td class="mdescLeft"> </td><td class="mdescRight">Contains the channel key. </em> <a href="#o8"></a><em><br><br></td></tr>
75 <tr><td class="memItemLeft" nowrap align=right valign=top>char </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o9">binarymodes</a></td></tr>
77 <tr><td class="mdescLeft"> </td><td class="mdescRight">Contains a bitmask of the CM_* builtin (RFC) binary mode symbols. </em> <a href="#o9"></a><em><br><br></td></tr>
78 <tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="channels_8h.html#a11">BanList</a> </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o10">bans</a></td></tr>
80 <tr><td class="mdescLeft"> </td><td class="mdescRight">The list of all bans set on the channel. </em> <a href="#o10"></a><em><br><br></td></tr>
82 <hr><a name="_details"></a><h2>Detailed Description</h2>
83 Holds all relevent information for a channel.
85 This class represents a channel, and contains its name, modes, time created, topic, topic set time, etc, and an instance of the BanList type.
89 Definition at line <a class="el" href="channels_8h-source.html#l00101">101</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.<hr><h2>Constructor & Destructor Documentation</h2>
90 <a name="a8" doxytag="chanrec::chanrec"></a><p>
91 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
94 <table cellpadding="0" cellspacing="0" border="0">
96 <td class="md" nowrap valign="top"> chanrec::chanrec </td>
97 <td class="md" valign="top">( </td>
98 <td class="mdname1" valign="top" nowrap> </td>
99 <td class="md" valign="top"> ) </td>
100 <td class="md" nowrap></td>
107 <table cellspacing=5 cellpadding=0 border=0>
115 Creates a channel record and initialises it with default values.
119 Definition at line <a class="el" href="channels_8cpp-source.html#l00113">113</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
121 References <a class="el" href="channels_8h-source.html#l00145">binarymodes</a>, <a class="el" href="channels_8h-source.html#l00123">created</a>, <a class="el" href="channels_8h-source.html#l00110">custom_modes</a>, <a class="el" href="channels_8h-source.html#l00115">internal_userlist</a>, <a class="el" href="channels_8h-source.html#l00141">key</a>, <a class="el" href="channels_8h-source.html#l00136">limit</a>, <a class="el" href="channels_8h-source.html#l00106">name</a>, <a class="el" href="channels_8h-source.html#l00131">setby</a>, <a class="el" href="channels_8h-source.html#l00120">topic</a>, and <a class="el" href="channels_8h-source.html#l00127">topicset</a>.
123 <div class="fragment"><pre>00114 {
124 00115 strcpy(name,<span class="stringliteral">""</span>);
125 00116 strcpy(custom_modes,<span class="stringliteral">""</span>);
126 00117 strcpy(topic,<span class="stringliteral">""</span>);
127 00118 strcpy(setby,<span class="stringliteral">""</span>);
128 00119 strcpy(key,<span class="stringliteral">""</span>);
129 00120 <a class="code" href="classchanrec.html#o4">created</a> = <a class="code" href="classchanrec.html#o5">topicset</a> = <a class="code" href="classchanrec.html#o7">limit</a> = 0;
130 00121 <a class="code" href="classchanrec.html#o9">binarymodes</a> = 0;
131 00122 <a class="code" href="classchanrec.html#o2">internal_userlist</a>.clear();
136 <a name="a9" doxytag="chanrec::~chanrec"></a><p>
137 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
140 <table cellpadding="0" cellspacing="0" border="0">
142 <td class="md" nowrap valign="top"> virtual chanrec::~<a class="el" href="classchanrec.html">chanrec</a> </td>
143 <td class="md" valign="top">( </td>
144 <td class="mdname1" valign="top" nowrap> </td>
145 <td class="md" valign="top"> ) </td>
146 <td class="md" nowrap><code> [inline, virtual]</code></td>
153 <table cellspacing=5 cellpadding=0 border=0>
163 Definition at line <a class="el" href="channels_8h-source.html#l00205">205</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.
165 <div class="fragment"><pre>00205 { <span class="comment">/* stub */</span> }
169 <hr><h2>Member Function Documentation</h2>
170 <a name="a5" doxytag="chanrec::AddUser"></a><p>
171 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
174 <table cellpadding="0" cellspacing="0" border="0">
176 <td class="md" nowrap valign="top"> void chanrec::AddUser </td>
177 <td class="md" valign="top">( </td>
178 <td class="md" nowrap valign="top">char * </td>
179 <td class="mdname1" valign="top" nowrap> <em>castuser</em> </td>
180 <td class="md" valign="top"> ) </td>
181 <td class="md" nowrap></td>
188 <table cellspacing=5 cellpadding=0 border=0>
196 Add a user pointer to the internal reference list The data inserted into the reference list is a table as it is an arbitary pointer compared to other users by its memory address, as this is a very fast 32 or 64 bit integer comparison.
200 Definition at line <a class="el" href="channels_8cpp-source.html#l00207">207</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
202 References <a class="el" href="modules_8h-source.html#l00023">DEBUG</a>, and <a class="el" href="channels_8h-source.html#l00115">internal_userlist</a>.
204 <div class="fragment"><pre>00208 {
205 00209 <a class="code" href="classchanrec.html#o2">internal_userlist</a>.push_back(castuser);
206 00210 log(DEBUG,<span class="stringliteral">"Added casted user to channel's internal list"</span>);
211 <a name="a6" doxytag="chanrec::DelUser"></a><p>
212 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
215 <table cellpadding="0" cellspacing="0" border="0">
217 <td class="md" nowrap valign="top"> void chanrec::DelUser </td>
218 <td class="md" valign="top">( </td>
219 <td class="md" nowrap valign="top">char * </td>
220 <td class="mdname1" valign="top" nowrap> <em>castuser</em> </td>
221 <td class="md" valign="top"> ) </td>
222 <td class="md" nowrap></td>
229 <table cellspacing=5 cellpadding=0 border=0>
237 Delete a user pointer to the internal reference list The data removed from the reference list is a table as it is an arbitary pointer compared to other users by its memory address, as this is a very fast 32 or 64 bit integer comparison.
241 Definition at line <a class="el" href="channels_8cpp-source.html#l00213">213</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
243 References <a class="el" href="modules_8h-source.html#l00023">DEBUG</a>, <a class="el" href="channels_8h-source.html#l00115">internal_userlist</a>, and <a class="el" href="channels_8h-source.html#l00106">name</a>.
245 <div class="fragment"><pre>00214 {
246 00215 <span class="keywordflow">for</span> (std::vector<char*>::iterator a = <a class="code" href="classchanrec.html#o2">internal_userlist</a>.begin(); a < <a class="code" href="classchanrec.html#o2">internal_userlist</a>.end(); a++)
248 00217 <span class="keywordflow">if</span> (*a == castuser)
250 00219 log(DEBUG,<span class="stringliteral">"Removed casted user from channel's internal list"</span>);
251 00220 <a class="code" href="classchanrec.html#o2">internal_userlist</a>.erase(a);
252 00221 <span class="keywordflow">return</span>;
255 00224 log(DEBUG,<span class="stringliteral">"BUG BUG BUG! Attempt to remove an uncasted user from the internal list of %s!"</span>,name);
260 <a name="a3" doxytag="chanrec::GetModeParameter"></a><p>
261 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
264 <table cellpadding="0" cellspacing="0" border="0">
266 <td class="md" nowrap valign="top"> std::string chanrec::GetModeParameter </td>
267 <td class="md" valign="top">( </td>
268 <td class="md" nowrap valign="top">char </td>
269 <td class="mdname1" valign="top" nowrap> <em>mode</em> </td>
270 <td class="md" valign="top"> ) </td>
271 <td class="md" nowrap></td>
278 <table cellspacing=5 cellpadding=0 border=0>
286 Returns the parameter for a custom mode on a channel.
288 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.
290 Definition at line <a class="el" href="channels_8cpp-source.html#l00187">187</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
292 References <a class="el" href="channels_8cpp-source.html#l00111">custom_mode_params</a>.
294 <div class="fragment"><pre>00188 {
295 00189 <span class="keywordflow">if</span> (<a class="code" href="channels_8cpp.html#a38">custom_mode_params</a>.size())
297 00191 <span class="keywordflow">for</span> (vector<ModeParameter>::iterator i = <a class="code" href="channels_8cpp.html#a38">custom_mode_params</a>.begin(); i < <a class="code" href="channels_8cpp.html#a38">custom_mode_params</a>.end(); i++)
299 00193 <span class="keywordflow">if</span> ((i->mode == mode) && (!strcasecmp(this->name,i->channel)))
301 00195 <span class="keywordflow">return</span> i->parameter;
305 00199 <span class="keywordflow">return</span> <span class="stringliteral">""</span>;
310 <a name="a4" doxytag="chanrec::GetUserCounter"></a><p>
311 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
314 <table cellpadding="0" cellspacing="0" border="0">
316 <td class="md" nowrap valign="top"> long chanrec::GetUserCounter </td>
317 <td class="md" valign="top">( </td>
318 <td class="mdname1" valign="top" nowrap> </td>
319 <td class="md" valign="top"> ) </td>
320 <td class="md" nowrap></td>
327 <table cellspacing=5 cellpadding=0 border=0>
335 Obtain the channel "user counter" This returns the channel reference counter, which is initialized to 0 when the channel is created and incremented/decremented upon joins, parts quits and kicks.
339 Definition at line <a class="el" href="channels_8cpp-source.html#l00202">202</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
341 References <a class="el" href="channels_8h-source.html#l00115">internal_userlist</a>.
343 <div class="fragment"><pre>00203 {
344 00204 <span class="keywordflow">return</span> (this-><a class="code" href="classchanrec.html#o2">internal_userlist</a>.size());
349 <a name="a7" doxytag="chanrec::GetUsers"></a><p>
350 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
353 <table cellpadding="0" cellspacing="0" border="0">
355 <td class="md" nowrap valign="top"> std::vector< char * > * chanrec::GetUsers </td>
356 <td class="md" valign="top">( </td>
357 <td class="mdname1" valign="top" nowrap> </td>
358 <td class="md" valign="top"> ) </td>
359 <td class="md" nowrap></td>
366 <table cellspacing=5 cellpadding=0 border=0>
374 Obrain the internal reference list The internal reference list contains a list of userrec* cast to char*.
376 These are used for rapid comparison to determine channel membership for PRIVMSG, NOTICE, QUIT, PART etc. The resulting pointer to the vector should be considered readonly and only modified via AddUser and DelUser.
378 Definition at line <a class="el" href="channels_8cpp-source.html#l00227">227</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
380 References <a class="el" href="channels_8h-source.html#l00115">internal_userlist</a>.
382 Referenced by <a class="el" href="modules_8cpp-source.html#l00467">Server::GetUsers()</a>.
384 <div class="fragment"><pre>00228 {
385 00229 <span class="keywordflow">return</span> &<a class="code" href="classchanrec.html#o2">internal_userlist</a>;
390 <a name="a2" doxytag="chanrec::IsCustomModeSet"></a><p>
391 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
394 <table cellpadding="0" cellspacing="0" border="0">
396 <td class="md" nowrap valign="top"> bool chanrec::IsCustomModeSet </td>
397 <td class="md" valign="top">( </td>
398 <td class="md" nowrap valign="top">char </td>
399 <td class="mdname1" valign="top" nowrap> <em>mode</em> </td>
400 <td class="md" valign="top"> ) </td>
401 <td class="md" nowrap></td>
408 <table cellspacing=5 cellpadding=0 border=0>
416 Returns true if a custom mode is set on a channel.
420 Definition at line <a class="el" href="channels_8cpp-source.html#l00181">181</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
422 References <a class="el" href="modules_8h-source.html#l00023">DEBUG</a>.
424 <div class="fragment"><pre>00182 {
425 00183 log(DEBUG,<span class="stringliteral">"Checking ISCustomModeSet: %c %s"</span>,mode,this->custom_modes);
426 00184 <span class="keywordflow">return</span> (strchr(this->custom_modes,mode) != 0);
431 <a name="a0" doxytag="chanrec::SetCustomMode"></a><p>
432 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
435 <table cellpadding="0" cellspacing="0" border="0">
437 <td class="md" nowrap valign="top"> void chanrec::SetCustomMode </td>
438 <td class="md" valign="top">( </td>
439 <td class="md" nowrap valign="top">char </td>
440 <td class="mdname" nowrap> <em>mode</em>, </td>
445 <td class="md" nowrap>bool </td>
446 <td class="mdname" nowrap> <em>mode_on</em></td>
450 <td class="md">) </td>
451 <td class="md" colspan="2"></td>
458 <table cellspacing=5 cellpadding=0 border=0>
466 Sets or unsets a custom mode in the channels info.
470 Definition at line <a class="el" href="channels_8cpp-source.html#l00125">125</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
472 References <a class="el" href="channels_8h-source.html#l00110">custom_modes</a>, <a class="el" href="modules_8h-source.html#l00023">DEBUG</a>, and <a class="el" href="channels_8cpp-source.html#l00150">SetCustomModeParam()</a>.
474 <div class="fragment"><pre>00126 {
475 00127 <span class="keywordflow">if</span> (mode_on) {
476 00128 <span class="keyword">static</span> <span class="keywordtype">char</span> m[3];
478 00130 m[1] = <span class="charliteral">'\0'</span>;
479 00131 <span class="keywordflow">if</span> (!strchr(this->custom_modes,mode))
481 00133 strlcat(custom_modes,m,MAXMODES);
483 00135 log(DEBUG,<span class="stringliteral">"Custom mode %c set"</span>,mode);
485 00137 <span class="keywordflow">else</span> {
487 00139 std::string a = this-><a class="code" href="classchanrec.html#o1">custom_modes</a>;
488 00140 <span class="keywordtype">int</span> pos = a.find(mode);
489 00141 a.erase(pos,1);
490 00142 strncpy(this->custom_modes,a.c_str(),MAXMODES);
492 00144 log(DEBUG,<span class="stringliteral">"Custom mode %c removed: modelist='%s'"</span>,mode,this->custom_modes);
493 00145 this-><a class="code" href="classchanrec.html#a1">SetCustomModeParam</a>(mode,<span class="stringliteral">""</span>,<span class="keyword">false</span>);
499 <a name="a1" doxytag="chanrec::SetCustomModeParam"></a><p>
500 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
503 <table cellpadding="0" cellspacing="0" border="0">
505 <td class="md" nowrap valign="top"> void chanrec::SetCustomModeParam </td>
506 <td class="md" valign="top">( </td>
507 <td class="md" nowrap valign="top">char </td>
508 <td class="mdname" nowrap> <em>mode</em>, </td>
513 <td class="md" nowrap>char * </td>
514 <td class="mdname" nowrap> <em>parameter</em>, </td>
519 <td class="md" nowrap>bool </td>
520 <td class="mdname" nowrap> <em>mode_on</em></td>
524 <td class="md">) </td>
525 <td class="md" colspan="2"></td>
532 <table cellspacing=5 cellpadding=0 border=0>
540 Sets or unsets the parameters for a custom mode in a channels info.
544 Definition at line <a class="el" href="channels_8cpp-source.html#l00150">150</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
546 References <a class="el" href="channels_8h-source.html#l00082">ModeParameter::channel</a>, <a class="el" href="channels_8cpp-source.html#l00111">custom_mode_params</a>, <a class="el" href="modules_8h-source.html#l00023">DEBUG</a>, <a class="el" href="channels_8h-source.html#l00080">ModeParameter::mode</a>, and <a class="el" href="channels_8h-source.html#l00081">ModeParameter::parameter</a>.
548 Referenced by <a class="el" href="channels_8cpp-source.html#l00125">SetCustomMode()</a>.
550 <div class="fragment"><pre>00151 {
552 00153 log(DEBUG,<span class="stringliteral">"SetCustomModeParam called"</span>);
553 00154 <a class="code" href="classModeParameter.html">ModeParameter</a> M;
554 00155 M.<a class="code" href="classModeParameter.html#o0">mode</a> = mode;
555 00156 strlcpy(M.<a class="code" href="classModeParameter.html#o2">channel</a>,this->name,CHANMAX);
556 00157 strlcpy(M.<a class="code" href="classModeParameter.html#o1">parameter</a>,parameter,MAXBUF);
557 00158 <span class="keywordflow">if</span> (mode_on)
559 00160 log(DEBUG,<span class="stringliteral">"Custom mode parameter %c %s added"</span>,mode,parameter);
560 00161 <a class="code" href="channels_8cpp.html#a38">custom_mode_params</a>.push_back(M);
562 00163 <span class="keywordflow">else</span>
564 00165 <span class="keywordflow">if</span> (<a class="code" href="channels_8cpp.html#a38">custom_mode_params</a>.size())
566 00167 <span class="keywordflow">for</span> (vector<ModeParameter>::iterator i = <a class="code" href="channels_8cpp.html#a38">custom_mode_params</a>.begin(); i < <a class="code" href="channels_8cpp.html#a38">custom_mode_params</a>.end(); i++)
568 00169 <span class="keywordflow">if</span> ((i->mode == mode) && (!strcasecmp(this->name,i->channel)))
570 00171 log(DEBUG,<span class="stringliteral">"Custom mode parameter %c %s removed"</span>,mode,parameter);
571 00172 <a class="code" href="channels_8cpp.html#a38">custom_mode_params</a>.erase(i);
572 00173 <span class="keywordflow">return</span>;
576 00177 log(DEBUG,<span class="stringliteral">"*** BUG *** Attempt to remove non-existent mode parameter!"</span>);
582 <hr><h2>Member Data Documentation</h2>
583 <a name="o10" doxytag="chanrec::bans"></a><p>
584 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
587 <table cellpadding="0" cellspacing="0" border="0">
589 <td class="md" nowrap valign="top"> <a class="el" href="channels_8h.html#a11">BanList</a> <a class="el" href="classchanrec.html#o10">chanrec::bans</a>
594 <table cellspacing=5 cellpadding=0 border=0>
602 The list of all bans set on the channel.
606 Definition at line <a class="el" href="channels_8h-source.html#l00149">149</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. </td>
609 <a name="o9" doxytag="chanrec::binarymodes"></a><p>
610 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
613 <table cellpadding="0" cellspacing="0" border="0">
615 <td class="md" nowrap valign="top"> char <a class="el" href="classchanrec.html#o9">chanrec::binarymodes</a>
620 <table cellspacing=5 cellpadding=0 border=0>
628 Contains a bitmask of the CM_* builtin (RFC) binary mode symbols.
632 Definition at line <a class="el" href="channels_8h-source.html#l00145">145</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.
634 Referenced by <a class="el" href="channels_8cpp-source.html#l00113">chanrec()</a>. </td>
637 <a name="o4" doxytag="chanrec::created"></a><p>
638 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
641 <table cellpadding="0" cellspacing="0" border="0">
643 <td class="md" nowrap valign="top"> time_t <a class="el" href="classchanrec.html#o4">chanrec::created</a>
648 <table cellspacing=5 cellpadding=0 border=0>
660 Definition at line <a class="el" href="channels_8h-source.html#l00123">123</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.
662 Referenced by <a class="el" href="channels_8cpp-source.html#l00113">chanrec()</a>. </td>
665 <a name="o1" doxytag="chanrec::custom_modes"></a><p>
666 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
669 <table cellpadding="0" cellspacing="0" border="0">
671 <td class="md" nowrap valign="top"> char <a class="el" href="classchanrec.html#o1">chanrec::custom_modes</a>[MAXMODES]
676 <table cellspacing=5 cellpadding=0 border=0>
684 Custom modes for the channel.
686 Plugins may use this field in any way they see fit.
688 Definition at line <a class="el" href="channels_8h-source.html#l00110">110</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.
690 Referenced by <a class="el" href="channels_8cpp-source.html#l00113">chanrec()</a>, and <a class="el" href="channels_8cpp-source.html#l00125">SetCustomMode()</a>. </td>
693 <a name="o2" doxytag="chanrec::internal_userlist"></a><p>
694 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
697 <table cellpadding="0" cellspacing="0" border="0">
699 <td class="md" nowrap valign="top"> std::vector<char*> <a class="el" href="classchanrec.html#o2">chanrec::internal_userlist</a>
704 <table cellspacing=5 cellpadding=0 border=0>
712 User list (casted to char*'s to stop forward declaration stuff) (chicken and egg scenario!).
716 Definition at line <a class="el" href="channels_8h-source.html#l00115">115</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.
718 Referenced by <a class="el" href="channels_8cpp-source.html#l00207">AddUser()</a>, <a class="el" href="channels_8cpp-source.html#l00113">chanrec()</a>, <a class="el" href="channels_8cpp-source.html#l00213">DelUser()</a>, <a class="el" href="channels_8cpp-source.html#l00202">GetUserCounter()</a>, and <a class="el" href="channels_8cpp-source.html#l00227">GetUsers()</a>. </td>
721 <a name="o8" doxytag="chanrec::key"></a><p>
722 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
725 <table cellpadding="0" cellspacing="0" border="0">
727 <td class="md" nowrap valign="top"> char <a class="el" href="classchanrec.html#o8">chanrec::key</a>[32]
732 <table cellspacing=5 cellpadding=0 border=0>
740 Contains the channel key.
742 If this value is an empty string, there is no channel key in place.
744 Definition at line <a class="el" href="channels_8h-source.html#l00141">141</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.
746 Referenced by <a class="el" href="channels_8cpp-source.html#l00113">chanrec()</a>. </td>
749 <a name="o7" doxytag="chanrec::limit"></a><p>
750 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
753 <table cellpadding="0" cellspacing="0" border="0">
755 <td class="md" nowrap valign="top"> short int <a class="el" href="classchanrec.html#o7">chanrec::limit</a>
760 <table cellspacing=5 cellpadding=0 border=0>
768 Contains the channel user limit.
770 If this value is zero, there is no limit in place.
772 Definition at line <a class="el" href="channels_8h-source.html#l00136">136</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.
774 Referenced by <a class="el" href="channels_8cpp-source.html#l00113">chanrec()</a>. </td>
777 <a name="o0" doxytag="chanrec::name"></a><p>
778 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
781 <table cellpadding="0" cellspacing="0" border="0">
783 <td class="md" nowrap valign="top"> char <a class="el" href="classchanrec.html#o0">chanrec::name</a>[CHANMAX]
788 <table cellspacing=5 cellpadding=0 border=0>
800 Definition at line <a class="el" href="channels_8h-source.html#l00106">106</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.
802 Referenced by <a class="el" href="channels_8cpp-source.html#l00113">chanrec()</a>, <a class="el" href="channels_8cpp-source.html#l00213">DelUser()</a>, and <a class="el" href="modules_8cpp-source.html#l00700">Server::PseudoToUser()</a>. </td>
805 <a name="o6" doxytag="chanrec::setby"></a><p>
806 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
809 <table cellpadding="0" cellspacing="0" border="0">
811 <td class="md" nowrap valign="top"> char <a class="el" href="classchanrec.html#o6">chanrec::setby</a>[NICKMAX]
816 <table cellspacing=5 cellpadding=0 border=0>
824 The last user to set the topic.
826 If this member is an empty string, no topic was ever set.
828 Definition at line <a class="el" href="channels_8h-source.html#l00131">131</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.
830 Referenced by <a class="el" href="channels_8cpp-source.html#l00113">chanrec()</a>, and <a class="el" href="modules_8cpp-source.html#l00700">Server::PseudoToUser()</a>. </td>
833 <a name="o3" doxytag="chanrec::topic"></a><p>
834 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
837 <table cellpadding="0" cellspacing="0" border="0">
839 <td class="md" nowrap valign="top"> char <a class="el" href="classchanrec.html#o3">chanrec::topic</a>[MAXBUF]
844 <table cellspacing=5 cellpadding=0 border=0>
854 If this is an empty string, no channel topic is set.
856 Definition at line <a class="el" href="channels_8h-source.html#l00120">120</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.
858 Referenced by <a class="el" href="channels_8cpp-source.html#l00113">chanrec()</a>, and <a class="el" href="modules_8cpp-source.html#l00700">Server::PseudoToUser()</a>. </td>
861 <a name="o5" doxytag="chanrec::topicset"></a><p>
862 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
865 <table cellpadding="0" cellspacing="0" border="0">
867 <td class="md" nowrap valign="top"> time_t <a class="el" href="classchanrec.html#o5">chanrec::topicset</a>
872 <table cellspacing=5 cellpadding=0 border=0>
882 If no topic was ever set, this will be equal to <a class="el" href="classchanrec.html#o4">chanrec::created</a>
884 Definition at line <a class="el" href="channels_8h-source.html#l00127">127</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.
886 Referenced by <a class="el" href="channels_8cpp-source.html#l00113">chanrec()</a>, and <a class="el" href="modules_8cpp-source.html#l00700">Server::PseudoToUser()</a>. </td>
889 <hr>The documentation for this class was generated from the following files:<ul>
890 <li><a class="el" href="channels_8h-source.html">channels.h</a><li><a class="el" href="channels_8cpp-source.html">channels.cpp</a></ul>
891 <hr size="1"><address style="align: right;"><small>Generated on Thu May 12 22:59:01 2005 for InspIRCd by
892 <a href="http://www.doxygen.org/index.html">
893 <img src="doxygen.png" alt="doxygen" align="middle" border=0 >
894 </a>1.3.3 </small></address>