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.doxygen.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="namespacemembers.html">Namespace Members</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 Inheritance diagram for chanrec:<p><center><img src="classchanrec__inherit__graph.gif" border="0" usemap="#chanrec__inherit__map" alt="Inheritance graph"></center>
14 <map name="chanrec__inherit__map">
15 <area href="classExtensible.html" shape="rect" coords="8,82,90,109" alt="">
16 <area href="classclassbase.html" shape="rect" coords="9,8,89,34" alt="">
18 <center><font size="2">[<a target="top" href="graph_legend.html">legend</a>]</font></center>Collaboration diagram for chanrec:<p><center><img src="classchanrec__coll__graph.gif" border="0" usemap="#chanrec__coll__map" alt="Collaboration graph"></center>
19 <map name="chanrec__coll__map">
20 <area href="classExtensible.html" shape="rect" coords="69,205,152,232" alt="">
21 <area href="classclassbase.html" shape="rect" coords="69,98,149,125" alt="">
23 <center><font size="2">[<a target="top" href="graph_legend.html">legend</a>]</font></center><a href="classchanrec-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
25 <tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
26 <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>
28 <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>
29 <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>
31 <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>
32 <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>
34 <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>
35 <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>
37 <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>
38 <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>
40 <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>
41 <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>
43 <tr><td class="mdescLeft"> </td><td class="mdescRight">Add a user pointer to the internal reference list. </em> <a href="#a5"></a><em><br><br></td></tr>
44 <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>
46 <tr><td class="mdescLeft"> </td><td class="mdescRight">Delete a user pointer to the internal reference list. </em> <a href="#a6"></a><em><br><br></td></tr>
47 <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>
49 <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>
50 <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>
52 <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>
53 <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>
55 <tr><td colspan=2><br><h2>Public Attributes</h2></td></tr>
56 <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>
58 <tr><td class="mdescLeft"> </td><td class="mdescRight">The channels name. </em> <a href="#o0"></a><em><br><br></td></tr>
59 <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>
61 <tr><td class="mdescLeft"> </td><td class="mdescRight">Custom modes for the channel. </em> <a href="#o1"></a><em><br><br></td></tr>
62 <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>
64 <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>
65 <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>
67 <tr><td class="mdescLeft"> </td><td class="mdescRight">Channel topic. </em> <a href="#o3"></a><em><br><br></td></tr>
68 <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>
70 <tr><td class="mdescLeft"> </td><td class="mdescRight">Creation time. </em> <a href="#o4"></a><em><br><br></td></tr>
71 <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>
73 <tr><td class="mdescLeft"> </td><td class="mdescRight">Time topic was set. </em> <a href="#o5"></a><em><br><br></td></tr>
74 <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>
76 <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>
77 <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>
79 <tr><td class="mdescLeft"> </td><td class="mdescRight">Contains the channel user limit. </em> <a href="#o7"></a><em><br><br></td></tr>
80 <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>
82 <tr><td class="mdescLeft"> </td><td class="mdescRight">Contains the channel key. </em> <a href="#o8"></a><em><br><br></td></tr>
83 <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>
85 <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>
86 <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>
88 <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>
90 <hr><a name="_details"></a><h2>Detailed Description</h2>
91 Holds all relevent information for a channel.
93 This class represents a channel, and contains its name, modes, time created, topic, topic set time, etc, and an instance of the BanList type.
97 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>
98 <a name="a8" doxytag="chanrec::chanrec"></a><p>
99 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
102 <table cellpadding="0" cellspacing="0" border="0">
104 <td class="md" nowrap valign="top"> chanrec::chanrec </td>
105 <td class="md" valign="top">( </td>
106 <td class="mdname1" valign="top" nowrap> </td>
107 <td class="md" valign="top"> ) </td>
108 <td class="md" nowrap></td>
115 <table cellspacing=5 cellpadding=0 border=0>
123 Creates a channel record and initialises it with default values.
127 Definition at line <a class="el" href="channels_8cpp-source.html#l00107">107</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
129 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>.
131 <div class="fragment"><pre>00108 {
132 00109 strcpy(name,<span class="stringliteral">""</span>);
133 00110 strcpy(custom_modes,<span class="stringliteral">""</span>);
134 00111 strcpy(topic,<span class="stringliteral">""</span>);
135 00112 strcpy(setby,<span class="stringliteral">""</span>);
136 00113 strcpy(key,<span class="stringliteral">""</span>);
137 00114 <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;
138 00115 <a class="code" href="classchanrec.html#o9">binarymodes</a> = 0;
139 00116 <a class="code" href="classchanrec.html#o2">internal_userlist</a>.clear();
144 <a name="a9" doxytag="chanrec::~chanrec"></a><p>
145 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
148 <table cellpadding="0" cellspacing="0" border="0">
150 <td class="md" nowrap valign="top"> virtual chanrec::~<a class="el" href="classchanrec.html">chanrec</a> </td>
151 <td class="md" valign="top">( </td>
152 <td class="mdname1" valign="top" nowrap> </td>
153 <td class="md" valign="top"> ) </td>
154 <td class="md" nowrap><code> [inline, virtual]</code></td>
161 <table cellspacing=5 cellpadding=0 border=0>
171 Definition at line <a class="el" href="channels_8h-source.html#l00224">224</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.
173 <div class="fragment"><pre>00224 { <span class="comment">/* stub */</span> }
177 <hr><h2>Member Function Documentation</h2>
178 <a name="a5" doxytag="chanrec::AddUser"></a><p>
179 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
182 <table cellpadding="0" cellspacing="0" border="0">
184 <td class="md" nowrap valign="top"> void chanrec::AddUser </td>
185 <td class="md" valign="top">( </td>
186 <td class="md" nowrap valign="top">char * </td>
187 <td class="mdname1" valign="top" nowrap> <em>castuser</em> </td>
188 <td class="md" valign="top"> ) </td>
189 <td class="md" nowrap></td>
196 <table cellspacing=5 cellpadding=0 border=0>
204 Add a user pointer to the internal reference list.
206 <dl compact><dt><b>Parameters:</b></dt><dd>
207 <table border="0" cellspacing="2" cellpadding="0">
208 <tr><td valign=top><em>castuser</em> </td><td>This should be a pointer to a userrec, casted to char*</td></tr>
211 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.
213 Definition at line <a class="el" href="channels_8cpp-source.html#l00201">201</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
215 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>.
217 <div class="fragment"><pre>00202 {
218 00203 <a class="code" href="classchanrec.html#o2">internal_userlist</a>.push_back(castuser);
219 00204 log(DEBUG,<span class="stringliteral">"Added casted user to channel's internal list"</span>);
224 <a name="a6" doxytag="chanrec::DelUser"></a><p>
225 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
228 <table cellpadding="0" cellspacing="0" border="0">
230 <td class="md" nowrap valign="top"> void chanrec::DelUser </td>
231 <td class="md" valign="top">( </td>
232 <td class="md" nowrap valign="top">char * </td>
233 <td class="mdname1" valign="top" nowrap> <em>castuser</em> </td>
234 <td class="md" valign="top"> ) </td>
235 <td class="md" nowrap></td>
242 <table cellspacing=5 cellpadding=0 border=0>
250 Delete a user pointer to the internal reference list.
252 <dl compact><dt><b>Parameters:</b></dt><dd>
253 <table border="0" cellspacing="2" cellpadding="0">
254 <tr><td valign=top><em>castuser</em> </td><td>This should be a pointer to a userrec, casted to char*</td></tr>
257 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.
259 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>.
261 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>.
263 <div class="fragment"><pre>00208 {
264 00209 <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++)
266 00211 <span class="keywordflow">if</span> (*a == castuser)
268 00213 log(DEBUG,<span class="stringliteral">"Removed casted user from channel's internal list"</span>);
269 00214 <a class="code" href="classchanrec.html#o2">internal_userlist</a>.erase(a);
270 00215 <span class="keywordflow">return</span>;
273 00218 log(DEBUG,<span class="stringliteral">"BUG BUG BUG! Attempt to remove an uncasted user from the internal list of %s!"</span>,name);
278 <a name="a3" doxytag="chanrec::GetModeParameter"></a><p>
279 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
282 <table cellpadding="0" cellspacing="0" border="0">
284 <td class="md" nowrap valign="top"> std::string chanrec::GetModeParameter </td>
285 <td class="md" valign="top">( </td>
286 <td class="md" nowrap valign="top">char </td>
287 <td class="mdname1" valign="top" nowrap> <em>mode</em> </td>
288 <td class="md" valign="top"> ) </td>
289 <td class="md" nowrap></td>
296 <table cellspacing=5 cellpadding=0 border=0>
304 Returns the parameter for a custom mode on a channel.
306 <dl compact><dt><b>Parameters:</b></dt><dd>
307 <table border="0" cellspacing="2" cellpadding="0">
308 <tr><td valign=top><em>mode</em> </td><td>The mode character you wish to query</td></tr>
311 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.<p>
312 <dl compact><dt><b>Returns:</b></dt><dd>The parameter for this mode is returned, or an empty string</dd></dl>
315 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>.
317 References <a class="el" href="channels_8cpp-source.html#l00105">custom_mode_params</a>.
319 <div class="fragment"><pre>00182 {
320 00183 <span class="keywordflow">if</span> (<a class="code" href="channels_8cpp.html#a37">custom_mode_params</a>.size())
322 00185 <span class="keywordflow">for</span> (vector<ModeParameter>::iterator i = <a class="code" href="channels_8cpp.html#a37">custom_mode_params</a>.begin(); i < <a class="code" href="channels_8cpp.html#a37">custom_mode_params</a>.end(); i++)
324 00187 <span class="keywordflow">if</span> ((i->mode == mode) && (!strcasecmp(this->name,i->channel)))
326 00189 <span class="keywordflow">return</span> i->parameter;
330 00193 <span class="keywordflow">return</span> <span class="stringliteral">""</span>;
335 <a name="a4" doxytag="chanrec::GetUserCounter"></a><p>
336 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
339 <table cellpadding="0" cellspacing="0" border="0">
341 <td class="md" nowrap valign="top"> long chanrec::GetUserCounter </td>
342 <td class="md" valign="top">( </td>
343 <td class="mdname1" valign="top" nowrap> </td>
344 <td class="md" valign="top"> ) </td>
345 <td class="md" nowrap></td>
352 <table cellspacing=5 cellpadding=0 border=0>
360 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.
362 <dl compact><dt><b>Returns:</b></dt><dd>The number of users on this channel</dd></dl>
365 Definition at line <a class="el" href="channels_8cpp-source.html#l00196">196</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
367 References <a class="el" href="channels_8h-source.html#l00115">internal_userlist</a>.
369 <div class="fragment"><pre>00197 {
370 00198 <span class="keywordflow">return</span> (this-><a class="code" href="classchanrec.html#o2">internal_userlist</a>.size());
375 <a name="a7" doxytag="chanrec::GetUsers"></a><p>
376 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
379 <table cellpadding="0" cellspacing="0" border="0">
381 <td class="md" nowrap valign="top"> std::vector< char * > * chanrec::GetUsers </td>
382 <td class="md" valign="top">( </td>
383 <td class="mdname1" valign="top" nowrap> </td>
384 <td class="md" valign="top"> ) </td>
385 <td class="md" nowrap></td>
392 <table cellspacing=5 cellpadding=0 border=0>
400 Obrain the internal reference list The internal reference list contains a list of userrec* cast to char*.
402 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.<p>
403 <dl compact><dt><b>Returns:</b></dt><dd>This function returns a vector of userrec pointers, each of which has been casted to char* to prevent circular references</dd></dl>
406 Definition at line <a class="el" href="channels_8cpp-source.html#l00221">221</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
408 References <a class="el" href="channels_8h-source.html#l00115">internal_userlist</a>.
410 Referenced by <a class="el" href="modules_8cpp-source.html#l00400">Server::GetUsers()</a>.
412 <div class="fragment"><pre>00222 {
413 00223 <span class="keywordflow">return</span> &<a class="code" href="classchanrec.html#o2">internal_userlist</a>;
418 <a name="a2" doxytag="chanrec::IsCustomModeSet"></a><p>
419 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
422 <table cellpadding="0" cellspacing="0" border="0">
424 <td class="md" nowrap valign="top"> bool chanrec::IsCustomModeSet </td>
425 <td class="md" valign="top">( </td>
426 <td class="md" nowrap valign="top">char </td>
427 <td class="mdname1" valign="top" nowrap> <em>mode</em> </td>
428 <td class="md" valign="top"> ) </td>
429 <td class="md" nowrap></td>
436 <table cellspacing=5 cellpadding=0 border=0>
444 Returns true if a custom mode is set on a channel.
446 <dl compact><dt><b>Parameters:</b></dt><dd>
447 <table border="0" cellspacing="2" cellpadding="0">
448 <tr><td valign=top><em>mode</em> </td><td>The mode character you wish to query </td></tr>
451 <dl compact><dt><b>Returns:</b></dt><dd>True if the custom mode is set, false if otherwise</dd></dl>
454 Definition at line <a class="el" href="channels_8cpp-source.html#l00175">175</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
456 References <a class="el" href="modules_8h-source.html#l00023">DEBUG</a>.
458 <div class="fragment"><pre>00176 {
459 00177 log(DEBUG,<span class="stringliteral">"Checking ISCustomModeSet: %c %s"</span>,mode,this->custom_modes);
460 00178 <span class="keywordflow">return</span> (strchr(this->custom_modes,mode) != 0);
465 <a name="a0" doxytag="chanrec::SetCustomMode"></a><p>
466 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
469 <table cellpadding="0" cellspacing="0" border="0">
471 <td class="md" nowrap valign="top"> void chanrec::SetCustomMode </td>
472 <td class="md" valign="top">( </td>
473 <td class="md" nowrap valign="top">char </td>
474 <td class="mdname" nowrap> <em>mode</em>, </td>
479 <td class="md" nowrap>bool </td>
480 <td class="mdname" nowrap> <em>mode_on</em></td>
484 <td class="md">) </td>
485 <td class="md" colspan="2"></td>
492 <table cellspacing=5 cellpadding=0 border=0>
500 Sets or unsets a custom mode in the channels info.
502 <dl compact><dt><b>Parameters:</b></dt><dd>
503 <table border="0" cellspacing="2" cellpadding="0">
504 <tr><td valign=top><em>mode</em> </td><td>The mode character to set or unset </td></tr>
505 <tr><td valign=top><em>mode_on</em> </td><td>True if you want to set the mode or false if you want to remove it</td></tr>
510 Definition at line <a class="el" href="channels_8cpp-source.html#l00119">119</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
512 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#l00144">SetCustomModeParam()</a>.
514 <div class="fragment"><pre>00120 {
515 00121 <span class="keywordflow">if</span> (mode_on) {
516 00122 <span class="keyword">static</span> <span class="keywordtype">char</span> m[3];
518 00124 m[1] = <span class="charliteral">'\0'</span>;
519 00125 <span class="keywordflow">if</span> (!strchr(this->custom_modes,mode))
521 00127 strlcat(custom_modes,m,MAXMODES);
523 00129 log(DEBUG,<span class="stringliteral">"Custom mode %c set"</span>,mode);
525 00131 <span class="keywordflow">else</span> {
527 00133 std::string a = this-><a class="code" href="classchanrec.html#o1">custom_modes</a>;
528 00134 <span class="keywordtype">int</span> pos = a.find(mode);
529 00135 a.erase(pos,1);
530 00136 strncpy(this->custom_modes,a.c_str(),MAXMODES);
532 00138 log(DEBUG,<span class="stringliteral">"Custom mode %c removed: modelist='%s'"</span>,mode,this->custom_modes);
533 00139 this-><a class="code" href="classchanrec.html#a1">SetCustomModeParam</a>(mode,<span class="stringliteral">""</span>,<span class="keyword">false</span>);
539 <a name="a1" doxytag="chanrec::SetCustomModeParam"></a><p>
540 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
543 <table cellpadding="0" cellspacing="0" border="0">
545 <td class="md" nowrap valign="top"> void chanrec::SetCustomModeParam </td>
546 <td class="md" valign="top">( </td>
547 <td class="md" nowrap valign="top">char </td>
548 <td class="mdname" nowrap> <em>mode</em>, </td>
553 <td class="md" nowrap>char * </td>
554 <td class="mdname" nowrap> <em>parameter</em>, </td>
559 <td class="md" nowrap>bool </td>
560 <td class="mdname" nowrap> <em>mode_on</em></td>
564 <td class="md">) </td>
565 <td class="md" colspan="2"></td>
572 <table cellspacing=5 cellpadding=0 border=0>
580 Sets or unsets the parameters for a custom mode in a channels info.
582 <dl compact><dt><b>Parameters:</b></dt><dd>
583 <table border="0" cellspacing="2" cellpadding="0">
584 <tr><td valign=top><em>mode</em> </td><td>The mode character to set or unset </td></tr>
585 <tr><td valign=top><em>parameter</em> </td><td>The parameter string to associate with this mode character </td></tr>
586 <tr><td valign=top><em>mode_on</em> </td><td>True if you want to set the mode or false if you want to remove it</td></tr>
591 Definition at line <a class="el" href="channels_8cpp-source.html#l00144">144</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
593 References <a class="el" href="channels_8h-source.html#l00082">ModeParameter::channel</a>, <a class="el" href="channels_8cpp-source.html#l00105">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>.
595 Referenced by <a class="el" href="channels_8cpp-source.html#l00119">SetCustomMode()</a>.
597 <div class="fragment"><pre>00145 {
599 00147 log(DEBUG,<span class="stringliteral">"SetCustomModeParam called"</span>);
600 00148 <a class="code" href="classModeParameter.html">ModeParameter</a> M;
601 00149 M.<a class="code" href="classModeParameter.html#o0">mode</a> = mode;
602 00150 strlcpy(M.<a class="code" href="classModeParameter.html#o2">channel</a>,this->name,CHANMAX);
603 00151 strlcpy(M.<a class="code" href="classModeParameter.html#o1">parameter</a>,parameter,MAXBUF);
604 00152 <span class="keywordflow">if</span> (mode_on)
606 00154 log(DEBUG,<span class="stringliteral">"Custom mode parameter %c %s added"</span>,mode,parameter);
607 00155 <a class="code" href="channels_8cpp.html#a37">custom_mode_params</a>.push_back(M);
609 00157 <span class="keywordflow">else</span>
611 00159 <span class="keywordflow">if</span> (<a class="code" href="channels_8cpp.html#a37">custom_mode_params</a>.size())
613 00161 <span class="keywordflow">for</span> (vector<ModeParameter>::iterator i = <a class="code" href="channels_8cpp.html#a37">custom_mode_params</a>.begin(); i < <a class="code" href="channels_8cpp.html#a37">custom_mode_params</a>.end(); i++)
615 00163 <span class="keywordflow">if</span> ((i->mode == mode) && (!strcasecmp(this->name,i->channel)))
617 00165 log(DEBUG,<span class="stringliteral">"Custom mode parameter %c %s removed"</span>,mode,parameter);
618 00166 <a class="code" href="channels_8cpp.html#a37">custom_mode_params</a>.erase(i);
619 00167 <span class="keywordflow">return</span>;
623 00171 log(DEBUG,<span class="stringliteral">"*** BUG *** Attempt to remove non-existent mode parameter!"</span>);
629 <hr><h2>Member Data Documentation</h2>
630 <a name="o10" doxytag="chanrec::bans"></a><p>
631 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
634 <table cellpadding="0" cellspacing="0" border="0">
636 <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>
641 <table cellspacing=5 cellpadding=0 border=0>
649 The list of all bans set on the channel.
653 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>
656 <a name="o9" doxytag="chanrec::binarymodes"></a><p>
657 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
660 <table cellpadding="0" cellspacing="0" border="0">
662 <td class="md" nowrap valign="top"> char <a class="el" href="classchanrec.html#o9">chanrec::binarymodes</a>
667 <table cellspacing=5 cellpadding=0 border=0>
675 Contains a bitmask of the CM_* builtin (RFC) binary mode symbols.
679 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>.
681 Referenced by <a class="el" href="channels_8cpp-source.html#l00107">chanrec()</a>. </td>
684 <a name="o4" doxytag="chanrec::created"></a><p>
685 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
688 <table cellpadding="0" cellspacing="0" border="0">
690 <td class="md" nowrap valign="top"> time_t <a class="el" href="classchanrec.html#o4">chanrec::created</a>
695 <table cellspacing=5 cellpadding=0 border=0>
707 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>.
709 Referenced by <a class="el" href="channels_8cpp-source.html#l00107">chanrec()</a>. </td>
712 <a name="o1" doxytag="chanrec::custom_modes"></a><p>
713 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
716 <table cellpadding="0" cellspacing="0" border="0">
718 <td class="md" nowrap valign="top"> char <a class="el" href="classchanrec.html#o1">chanrec::custom_modes</a>[MAXMODES]
723 <table cellspacing=5 cellpadding=0 border=0>
731 Custom modes for the channel.
733 Plugins may use this field in any way they see fit.
735 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>.
737 Referenced by <a class="el" href="channels_8cpp-source.html#l00107">chanrec()</a>, and <a class="el" href="channels_8cpp-source.html#l00119">SetCustomMode()</a>. </td>
740 <a name="o2" doxytag="chanrec::internal_userlist"></a><p>
741 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
744 <table cellpadding="0" cellspacing="0" border="0">
746 <td class="md" nowrap valign="top"> std::vector<char*> <a class="el" href="classchanrec.html#o2">chanrec::internal_userlist</a>
751 <table cellspacing=5 cellpadding=0 border=0>
759 User list (casted to char*'s to stop forward declaration stuff) (chicken and egg scenario!).
763 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>.
765 Referenced by <a class="el" href="channels_8cpp-source.html#l00201">AddUser()</a>, <a class="el" href="channels_8cpp-source.html#l00107">chanrec()</a>, <a class="el" href="channels_8cpp-source.html#l00207">DelUser()</a>, <a class="el" href="channels_8cpp-source.html#l00196">GetUserCounter()</a>, and <a class="el" href="channels_8cpp-source.html#l00221">GetUsers()</a>. </td>
768 <a name="o8" doxytag="chanrec::key"></a><p>
769 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
772 <table cellpadding="0" cellspacing="0" border="0">
774 <td class="md" nowrap valign="top"> char <a class="el" href="classchanrec.html#o8">chanrec::key</a>[32]
779 <table cellspacing=5 cellpadding=0 border=0>
787 Contains the channel key.
789 If this value is an empty string, there is no channel key in place.
791 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>.
793 Referenced by <a class="el" href="channels_8cpp-source.html#l00107">chanrec()</a>. </td>
796 <a name="o7" doxytag="chanrec::limit"></a><p>
797 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
800 <table cellpadding="0" cellspacing="0" border="0">
802 <td class="md" nowrap valign="top"> short int <a class="el" href="classchanrec.html#o7">chanrec::limit</a>
807 <table cellspacing=5 cellpadding=0 border=0>
815 Contains the channel user limit.
817 If this value is zero, there is no limit in place.
819 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>.
821 Referenced by <a class="el" href="channels_8cpp-source.html#l00107">chanrec()</a>. </td>
824 <a name="o0" doxytag="chanrec::name"></a><p>
825 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
828 <table cellpadding="0" cellspacing="0" border="0">
830 <td class="md" nowrap valign="top"> char <a class="el" href="classchanrec.html#o0">chanrec::name</a>[CHANMAX]
835 <table cellspacing=5 cellpadding=0 border=0>
847 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>.
849 Referenced by <a class="el" href="channels_8cpp-source.html#l00107">chanrec()</a>, <a class="el" href="channels_8cpp-source.html#l00207">DelUser()</a>, and <a class="el" href="modules_8cpp-source.html#l00649">Server::PseudoToUser()</a>. </td>
852 <a name="o6" doxytag="chanrec::setby"></a><p>
853 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
856 <table cellpadding="0" cellspacing="0" border="0">
858 <td class="md" nowrap valign="top"> char <a class="el" href="classchanrec.html#o6">chanrec::setby</a>[NICKMAX]
863 <table cellspacing=5 cellpadding=0 border=0>
871 The last user to set the topic.
873 If this member is an empty string, no topic was ever set.
875 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>.
877 Referenced by <a class="el" href="channels_8cpp-source.html#l00107">chanrec()</a>, and <a class="el" href="modules_8cpp-source.html#l00649">Server::PseudoToUser()</a>. </td>
880 <a name="o3" doxytag="chanrec::topic"></a><p>
881 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
884 <table cellpadding="0" cellspacing="0" border="0">
886 <td class="md" nowrap valign="top"> char <a class="el" href="classchanrec.html#o3">chanrec::topic</a>[MAXBUF]
891 <table cellspacing=5 cellpadding=0 border=0>
901 If this is an empty string, no channel topic is set.
903 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>.
905 Referenced by <a class="el" href="channels_8cpp-source.html#l00107">chanrec()</a>, and <a class="el" href="modules_8cpp-source.html#l00649">Server::PseudoToUser()</a>. </td>
908 <a name="o5" doxytag="chanrec::topicset"></a><p>
909 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
912 <table cellpadding="0" cellspacing="0" border="0">
914 <td class="md" nowrap valign="top"> time_t <a class="el" href="classchanrec.html#o5">chanrec::topicset</a>
919 <table cellspacing=5 cellpadding=0 border=0>
929 If no topic was ever set, this will be equal to <a class="el" href="classchanrec.html#o4">chanrec::created</a>
931 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>.
933 Referenced by <a class="el" href="channels_8cpp-source.html#l00107">chanrec()</a>, and <a class="el" href="modules_8cpp-source.html#l00649">Server::PseudoToUser()</a>. </td>
936 <hr>The documentation for this class was generated from the following files:<ul>
937 <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>
938 <hr size="1"><address style="align: right;"><small>Generated on Wed May 25 22:02:48 2005 for InspIRCd by
939 <a href="http://www.doxygen.org/index.html">
940 <img src="doxygen.png" alt="doxygen" align="middle" border=0 >
941 </a>1.3.3 </small></address>