1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 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.4.4-20050815 -->
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">Class List</a> | <a class="qindex" href="dirs.html">Directories</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">Class Members</a> | <a class="qindex" href="globals.html">File Members</a></div>
8 <h1>chanrec Class Reference</h1><!-- doxytag: class="chanrec" --><!-- doxytag: inherits="Extensible" -->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="7,81,89,108" alt="">
16 <area href="classclassbase.html" shape="rect" coords="8,7,88,33" 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="68,204,151,231" alt="">
21 <area href="classclassbase.html" shape="rect" coords="68,97,148,124" 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#SetCustomMode_28char_20mode_2C_20bool_20mode_5Fon_29">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. <a href="#SetCustomMode_28char_20mode_2C_20bool_20mode_5Fon_29"></a><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#SetCustomModeParam_28char_20mode_2C_20char_20_2Aparameter_2C_20bool_20mode_5Fon_29">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. <a href="#SetCustomModeParam_28char_20mode_2C_20char_20_2Aparameter_2C_20bool_20mode_5Fon_29"></a><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#IsCustomModeSet_28char_20mode_29">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. <a href="#IsCustomModeSet_28char_20mode_29"></a><br></td></tr>
35 <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="namespaceirc.html#string">std::string</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classchanrec.html#GetModeParameter_28char_20mode_29">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. <a href="#GetModeParameter_28char_20mode_29"></a><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#GetUserCounter_28_29">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. <a href="#GetUserCounter_28_29"></a><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#AddUser_28char_20_2Acastuser_29">AddUser</a> (char *castuser)</td></tr>
43 <tr><td class="mdescLeft"> </td><td class="mdescRight">Add a user pointer to the internal reference list. <a href="#AddUser_28char_20_2Acastuser_29"></a><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#DelUser_28char_20_2Acastuser_29">DelUser</a> (char *castuser)</td></tr>
46 <tr><td class="mdescLeft"> </td><td class="mdescRight">Delete a user pointer to the internal reference list. <a href="#DelUser_28char_20_2Acastuser_29"></a><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#GetUsers_28_29">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*. <a href="#GetUsers_28_29"></a><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#chanrec_28_29">chanrec</a> ()</td></tr>
52 <tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a channel record and initialises it with default values. <a href="#chanrec_28_29"></a><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#_7Echanrec_28_29">~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#name_5BCHANMAX_5D">name</a> [CHANMAX]</td></tr>
58 <tr><td class="mdescLeft"> </td><td class="mdescRight">The channels name. <a href="#name_5BCHANMAX_5D"></a><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#custom_5Fmodes_5BMAXMODES_5D">custom_modes</a> [MAXMODES]</td></tr>
61 <tr><td class="mdescLeft"> </td><td class="mdescRight">Custom modes for the channel. <a href="#custom_5Fmodes_5BMAXMODES_5D"></a><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#internal_5Fuserlist">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!). <a href="#internal_5Fuserlist"></a><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#topic_5BMAXBUF_5D">topic</a> [MAXBUF]</td></tr>
67 <tr><td class="mdescLeft"> </td><td class="mdescRight">Channel topic. <a href="#topic_5BMAXBUF_5D"></a><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#created">created</a></td></tr>
70 <tr><td class="mdescLeft"> </td><td class="mdescRight">Creation time. <a href="#created"></a><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#topicset">topicset</a></td></tr>
73 <tr><td class="mdescLeft"> </td><td class="mdescRight">Time topic was set. <a href="#topicset"></a><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#setby_5BNICKMAX_5D">setby</a> [NICKMAX]</td></tr>
76 <tr><td class="mdescLeft"> </td><td class="mdescRight">The last user to set the topic. <a href="#setby_5BNICKMAX_5D"></a><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#limit">limit</a></td></tr>
79 <tr><td class="mdescLeft"> </td><td class="mdescRight">Contains the channel user limit. <a href="#limit"></a><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#key_5B_33_32_5D">key</a> [32]</td></tr>
82 <tr><td class="mdescLeft"> </td><td class="mdescRight">Contains the channel key. <a href="#key_5B_33_32_5D"></a><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#binarymodes">binarymodes</a></td></tr>
85 <tr><td class="mdescLeft"> </td><td class="mdescRight">Contains a bitmask of the CM_* builtin (RFC) binary mode symbols. <a href="#binarymodes"></a><br></td></tr>
86 <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="channels_8h.html#BanList">BanList</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classchanrec.html#bans">bans</a></td></tr>
88 <tr><td class="mdescLeft"> </td><td class="mdescRight">The list of all bans set on the channel. <a href="#bans"></a><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 class="anchor" name="chanrec_28_29"></a><!-- doxytag: member="chanrec::chanrec" ref="chanrec_28_29" args="()" --><p>
99 <table class="mdTable" 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>
114 <table cellspacing="5" cellpadding="0" border="0">
122 Creates a channel record and initialises it with default values.
126 Definition at line <a class="el" href="channels_8cpp-source.html#l00101">101</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
128 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>.<div class="fragment"><pre class="fragment"><a name="l00102"></a>00102 {
129 <a name="l00103"></a>00103 strcpy(<a class="code" href="classchanrec.html#name_5BCHANMAX_5D">name</a>,<span class="stringliteral">""</span>);
130 <a name="l00104"></a>00104 strcpy(<a class="code" href="classchanrec.html#custom_5Fmodes_5BMAXMODES_5D">custom_modes</a>,<span class="stringliteral">""</span>);
131 <a name="l00105"></a>00105 strcpy(<a class="code" href="classchanrec.html#topic_5BMAXBUF_5D">topic</a>,<span class="stringliteral">""</span>);
132 <a name="l00106"></a>00106 strcpy(<a class="code" href="classchanrec.html#setby_5BNICKMAX_5D">setby</a>,<span class="stringliteral">""</span>);
133 <a name="l00107"></a>00107 strcpy(<a class="code" href="classchanrec.html#key_5B_33_32_5D">key</a>,<span class="stringliteral">""</span>);
134 <a name="l00108"></a>00108 <a class="code" href="classchanrec.html#created">created</a> = <a class="code" href="classchanrec.html#topicset">topicset</a> = <a class="code" href="classchanrec.html#limit">limit</a> = 0;
135 <a name="l00109"></a>00109 <a class="code" href="classchanrec.html#binarymodes">binarymodes</a> = 0;
136 <a name="l00110"></a>00110 <a class="code" href="classchanrec.html#internal_5Fuserlist">internal_userlist</a>.clear();
137 <a name="l00111"></a>00111 }
143 <a class="anchor" name="_7Echanrec_28_29"></a><!-- doxytag: member="chanrec::~chanrec" ref="_7Echanrec_28_29" args="()" --><p>
144 <table class="mdTable" cellpadding="2" cellspacing="0">
147 <table cellpadding="0" cellspacing="0" border="0">
149 <td class="md" nowrap valign="top">virtual chanrec::~chanrec </td>
150 <td class="md" valign="top">( </td>
151 <td class="mdname1" valign="top" nowrap> </td>
152 <td class="md" valign="top"> ) </td>
153 <td class="md" nowrap><code> [inline, virtual]</code></td>
159 <table cellspacing="5" cellpadding="0" border="0">
169 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>.<div class="fragment"><pre class="fragment"><a name="l00224"></a>00224 { <span class="comment">/* stub */</span> }
175 <hr><h2>Member Function Documentation</h2>
176 <a class="anchor" name="AddUser_28char_20_2Acastuser_29"></a><!-- doxytag: member="chanrec::AddUser" ref="AddUser_28char_20_2Acastuser_29" args="(char *castuser)" --><p>
177 <table class="mdTable" cellpadding="2" cellspacing="0">
180 <table cellpadding="0" cellspacing="0" border="0">
182 <td class="md" nowrap valign="top">void chanrec::AddUser </td>
183 <td class="md" valign="top">( </td>
184 <td class="md" nowrap valign="top">char * </td>
185 <td class="mdname1" valign="top" nowrap> <em>castuser</em> </td>
186 <td class="md" valign="top"> ) </td>
187 <td class="md" nowrap></td>
193 <table cellspacing="5" cellpadding="0" border="0">
201 Add a user pointer to the internal reference list.
203 <dl compact><dt><b>Parameters:</b></dt><dd>
204 <table border="0" cellspacing="2" cellpadding="0">
205 <tr><td valign="top"></td><td valign="top"><em>castuser</em> </td><td>This should be a pointer to a userrec, casted to char*</td></tr>
208 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.
210 Definition at line <a class="el" href="channels_8cpp-source.html#l00195">195</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
212 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>.<div class="fragment"><pre class="fragment"><a name="l00196"></a>00196 {
213 <a name="l00197"></a>00197 <a class="code" href="classchanrec.html#internal_5Fuserlist">internal_userlist</a>.push_back(castuser);
214 <a name="l00198"></a>00198 log(<a class="code" href="modules_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"Added casted user to channel's internal list"</span>);
215 <a name="l00199"></a>00199 }
221 <a class="anchor" name="DelUser_28char_20_2Acastuser_29"></a><!-- doxytag: member="chanrec::DelUser" ref="DelUser_28char_20_2Acastuser_29" args="(char *castuser)" --><p>
222 <table class="mdTable" cellpadding="2" cellspacing="0">
225 <table cellpadding="0" cellspacing="0" border="0">
227 <td class="md" nowrap valign="top">void chanrec::DelUser </td>
228 <td class="md" valign="top">( </td>
229 <td class="md" nowrap valign="top">char * </td>
230 <td class="mdname1" valign="top" nowrap> <em>castuser</em> </td>
231 <td class="md" valign="top"> ) </td>
232 <td class="md" nowrap></td>
238 <table cellspacing="5" cellpadding="0" border="0">
246 Delete a user pointer to the internal reference list.
248 <dl compact><dt><b>Parameters:</b></dt><dd>
249 <table border="0" cellspacing="2" cellpadding="0">
250 <tr><td valign="top"></td><td valign="top"><em>castuser</em> </td><td>This should be a pointer to a userrec, casted to char*</td></tr>
253 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.
255 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>.
257 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>.<div class="fragment"><pre class="fragment"><a name="l00202"></a>00202 {
258 <a name="l00203"></a>00203 <span class="keywordflow">for</span> (std::vector<char*>::iterator a = <a class="code" href="classchanrec.html#internal_5Fuserlist">internal_userlist</a>.begin(); a < <a class="code" href="classchanrec.html#internal_5Fuserlist">internal_userlist</a>.end(); a++)
259 <a name="l00204"></a>00204 {
260 <a name="l00205"></a>00205 <span class="keywordflow">if</span> (*a == castuser)
261 <a name="l00206"></a>00206 {
262 <a name="l00207"></a>00207 log(<a class="code" href="modules_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"Removed casted user from channel's internal list"</span>);
263 <a name="l00208"></a>00208 <a class="code" href="classchanrec.html#internal_5Fuserlist">internal_userlist</a>.erase(a);
264 <a name="l00209"></a>00209 <span class="keywordflow">return</span>;
265 <a name="l00210"></a>00210 }
266 <a name="l00211"></a>00211 }
267 <a name="l00212"></a>00212 log(<a class="code" href="modules_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"BUG BUG BUG! Attempt to remove an uncasted user from the internal list of %s!"</span>,<a class="code" href="classchanrec.html#name_5BCHANMAX_5D">name</a>);
268 <a name="l00213"></a>00213 }
274 <a class="anchor" name="GetModeParameter_28char_20mode_29"></a><!-- doxytag: member="chanrec::GetModeParameter" ref="GetModeParameter_28char_20mode_29" args="(char mode)" --><p>
275 <table class="mdTable" cellpadding="2" cellspacing="0">
278 <table cellpadding="0" cellspacing="0" border="0">
280 <td class="md" nowrap valign="top"><a class="el" href="namespaceirc.html#string">std::string</a> chanrec::GetModeParameter </td>
281 <td class="md" valign="top">( </td>
282 <td class="md" nowrap valign="top">char </td>
283 <td class="mdname1" valign="top" nowrap> <em>mode</em> </td>
284 <td class="md" valign="top"> ) </td>
285 <td class="md" nowrap></td>
291 <table cellspacing="5" cellpadding="0" border="0">
299 Returns the parameter for a custom mode on a channel.
301 <dl compact><dt><b>Parameters:</b></dt><dd>
302 <table border="0" cellspacing="2" cellpadding="0">
303 <tr><td valign="top"></td><td valign="top"><em>mode</em> </td><td>The mode character you wish to query</td></tr>
306 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>
307 <dl compact><dt><b>Returns:</b></dt><dd>The parameter for this mode is returned, or an empty string</dd></dl>
310 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>.
312 References <a class="el" href="channels_8cpp-source.html#l00099">custom_mode_params</a>.<div class="fragment"><pre class="fragment"><a name="l00176"></a>00176 {
313 <a name="l00177"></a>00177 <span class="keywordflow">if</span> (<a class="code" href="channels_8cpp.html#custom_5Fmode_5Fparams">custom_mode_params</a>.size())
314 <a name="l00178"></a>00178 {
315 <a name="l00179"></a>00179 <span class="keywordflow">for</span> (vector<ModeParameter>::iterator i = <a class="code" href="channels_8cpp.html#custom_5Fmode_5Fparams">custom_mode_params</a>.begin(); i < <a class="code" href="channels_8cpp.html#custom_5Fmode_5Fparams">custom_mode_params</a>.end(); i++)
316 <a name="l00180"></a>00180 {
317 <a name="l00181"></a>00181 <span class="keywordflow">if</span> ((i->mode == mode) && (!strcasecmp(this->name,i->channel)))
318 <a name="l00182"></a>00182 {
319 <a name="l00183"></a>00183 <span class="keywordflow">return</span> i->parameter;
320 <a name="l00184"></a>00184 }
321 <a name="l00185"></a>00185 }
322 <a name="l00186"></a>00186 }
323 <a name="l00187"></a>00187 <span class="keywordflow">return</span> <span class="stringliteral">""</span>;
324 <a name="l00188"></a>00188 }
330 <a class="anchor" name="GetUserCounter_28_29"></a><!-- doxytag: member="chanrec::GetUserCounter" ref="GetUserCounter_28_29" args="()" --><p>
331 <table class="mdTable" cellpadding="2" cellspacing="0">
334 <table cellpadding="0" cellspacing="0" border="0">
336 <td class="md" nowrap valign="top">long chanrec::GetUserCounter </td>
337 <td class="md" valign="top">( </td>
338 <td class="mdname1" valign="top" nowrap> </td>
339 <td class="md" valign="top"> ) </td>
340 <td class="md" nowrap></td>
346 <table cellspacing="5" cellpadding="0" border="0">
354 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.
356 <dl compact><dt><b>Returns:</b></dt><dd>The number of users on this channel</dd></dl>
359 Definition at line <a class="el" href="channels_8cpp-source.html#l00190">190</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.<div class="fragment"><pre class="fragment"><a name="l00191"></a>00191 {
360 <a name="l00192"></a>00192 <span class="keywordflow">return</span> (this->internal_userlist.size());
361 <a name="l00193"></a>00193 }
367 <a class="anchor" name="GetUsers_28_29"></a><!-- doxytag: member="chanrec::GetUsers" ref="GetUsers_28_29" args="()" --><p>
368 <table class="mdTable" cellpadding="2" cellspacing="0">
371 <table cellpadding="0" cellspacing="0" border="0">
373 <td class="md" nowrap valign="top">std::vector< char * > * chanrec::GetUsers </td>
374 <td class="md" valign="top">( </td>
375 <td class="mdname1" valign="top" nowrap> </td>
376 <td class="md" valign="top"> ) </td>
377 <td class="md" nowrap></td>
383 <table cellspacing="5" cellpadding="0" border="0">
391 Obrain the internal reference list The internal reference list contains a list of userrec* cast to char*.
393 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>
394 <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>
397 Definition at line <a class="el" href="channels_8cpp-source.html#l00215">215</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
399 References <a class="el" href="channels_8h-source.html#l00115">internal_userlist</a>.
401 Referenced by <a class="el" href="modules_8cpp-source.html#l00453">Server::GetUsers()</a>.<div class="fragment"><pre class="fragment"><a name="l00216"></a>00216 {
402 <a name="l00217"></a>00217 <span class="keywordflow">return</span> &<a class="code" href="classchanrec.html#internal_5Fuserlist">internal_userlist</a>;
403 <a name="l00218"></a>00218 }
409 <a class="anchor" name="IsCustomModeSet_28char_20mode_29"></a><!-- doxytag: member="chanrec::IsCustomModeSet" ref="IsCustomModeSet_28char_20mode_29" args="(char mode)" --><p>
410 <table class="mdTable" cellpadding="2" cellspacing="0">
413 <table cellpadding="0" cellspacing="0" border="0">
415 <td class="md" nowrap valign="top">bool chanrec::IsCustomModeSet </td>
416 <td class="md" valign="top">( </td>
417 <td class="md" nowrap valign="top">char </td>
418 <td class="mdname1" valign="top" nowrap> <em>mode</em> </td>
419 <td class="md" valign="top"> ) </td>
420 <td class="md" nowrap></td>
426 <table cellspacing="5" cellpadding="0" border="0">
434 Returns true if a custom mode is set on a channel.
436 <dl compact><dt><b>Parameters:</b></dt><dd>
437 <table border="0" cellspacing="2" cellpadding="0">
438 <tr><td valign="top"></td><td valign="top"><em>mode</em> </td><td>The mode character you wish to query </td></tr>
441 <dl compact><dt><b>Returns:</b></dt><dd>True if the custom mode is set, false if otherwise</dd></dl>
444 Definition at line <a class="el" href="channels_8cpp-source.html#l00169">169</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
446 References <a class="el" href="modules_8h-source.html#l00023">DEBUG</a>.<div class="fragment"><pre class="fragment"><a name="l00170"></a>00170 {
447 <a name="l00171"></a>00171 log(<a class="code" href="modules_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"Checking ISCustomModeSet: %c %s"</span>,mode,this->custom_modes);
448 <a name="l00172"></a>00172 <span class="keywordflow">return</span> (strchr(this->custom_modes,mode) != 0);
449 <a name="l00173"></a>00173 }
455 <a class="anchor" name="SetCustomMode_28char_20mode_2C_20bool_20mode_5Fon_29"></a><!-- doxytag: member="chanrec::SetCustomMode" ref="SetCustomMode_28char_20mode_2C_20bool_20mode_5Fon_29" args="(char mode, bool mode_on)" --><p>
456 <table class="mdTable" cellpadding="2" cellspacing="0">
459 <table cellpadding="0" cellspacing="0" border="0">
461 <td class="md" nowrap valign="top">void chanrec::SetCustomMode </td>
462 <td class="md" valign="top">( </td>
463 <td class="md" nowrap valign="top">char </td>
464 <td class="mdname" nowrap> <em>mode</em>, </td>
467 <td class="md" nowrap align="right"></td>
469 <td class="md" nowrap>bool </td>
470 <td class="mdname" nowrap> <em>mode_on</em></td>
474 <td class="md">) </td>
475 <td class="md" colspan="2"></td>
481 <table cellspacing="5" cellpadding="0" border="0">
489 Sets or unsets a custom mode in the channels info.
491 <dl compact><dt><b>Parameters:</b></dt><dd>
492 <table border="0" cellspacing="2" cellpadding="0">
493 <tr><td valign="top"></td><td valign="top"><em>mode</em> </td><td>The mode character to set or unset </td></tr>
494 <tr><td valign="top"></td><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>
499 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>.
501 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#l00138">SetCustomModeParam()</a>.<div class="fragment"><pre class="fragment"><a name="l00114"></a>00114 {
502 <a name="l00115"></a>00115 <span class="keywordflow">if</span> (mode_on) {
503 <a name="l00116"></a>00116 <span class="keyword">static</span> <span class="keywordtype">char</span> m[3];
504 <a name="l00117"></a>00117 m[0] = mode;
505 <a name="l00118"></a>00118 m[1] = <span class="charliteral">'\0'</span>;
506 <a name="l00119"></a>00119 <span class="keywordflow">if</span> (!strchr(this->custom_modes,mode))
507 <a name="l00120"></a>00120 {
508 <a name="l00121"></a>00121 strlcat(<a class="code" href="classchanrec.html#custom_5Fmodes_5BMAXMODES_5D">custom_modes</a>,m,MAXMODES);
509 <a name="l00122"></a>00122 }
510 <a name="l00123"></a>00123 log(<a class="code" href="modules_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"Custom mode %c set"</span>,mode);
511 <a name="l00124"></a>00124 }
512 <a name="l00125"></a>00125 <span class="keywordflow">else</span> {
513 <a name="l00126"></a>00126
514 <a name="l00127"></a>00127 <a class="code" href="namespaceirc.html#string">std::string</a> a = this-><a class="code" href="classchanrec.html#custom_5Fmodes_5BMAXMODES_5D">custom_modes</a>;
515 <a name="l00128"></a>00128 <span class="keywordtype">int</span> pos = a.find(mode);
516 <a name="l00129"></a>00129 a.erase(pos,1);
517 <a name="l00130"></a>00130 strncpy(this->custom_modes,a.c_str(),MAXMODES);
518 <a name="l00131"></a>00131
519 <a name="l00132"></a>00132 log(<a class="code" href="modules_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"Custom mode %c removed: modelist='%s'"</span>,mode,this->custom_modes);
520 <a name="l00133"></a>00133 this-><a class="code" href="classchanrec.html#SetCustomModeParam_28char_20mode_2C_20char_20_2Aparameter_2C_20bool_20mode_5Fon_29">SetCustomModeParam</a>(mode,<span class="stringliteral">""</span>,<span class="keyword">false</span>);
521 <a name="l00134"></a>00134 }
522 <a name="l00135"></a>00135 }
528 <a class="anchor" name="SetCustomModeParam_28char_20mode_2C_20char_20_2Aparameter_2C_20bool_20mode_5Fon_29"></a><!-- doxytag: member="chanrec::SetCustomModeParam" ref="SetCustomModeParam_28char_20mode_2C_20char_20_2Aparameter_2C_20bool_20mode_5Fon_29" args="(char mode, char *parameter, bool mode_on)" --><p>
529 <table class="mdTable" cellpadding="2" cellspacing="0">
532 <table cellpadding="0" cellspacing="0" border="0">
534 <td class="md" nowrap valign="top">void chanrec::SetCustomModeParam </td>
535 <td class="md" valign="top">( </td>
536 <td class="md" nowrap valign="top">char </td>
537 <td class="mdname" nowrap> <em>mode</em>, </td>
540 <td class="md" nowrap align="right"></td>
542 <td class="md" nowrap>char * </td>
543 <td class="mdname" nowrap> <em>parameter</em>, </td>
546 <td class="md" nowrap align="right"></td>
548 <td class="md" nowrap>bool </td>
549 <td class="mdname" nowrap> <em>mode_on</em></td>
553 <td class="md">) </td>
554 <td class="md" colspan="2"></td>
560 <table cellspacing="5" cellpadding="0" border="0">
568 Sets or unsets the parameters for a custom mode in a channels info.
570 <dl compact><dt><b>Parameters:</b></dt><dd>
571 <table border="0" cellspacing="2" cellpadding="0">
572 <tr><td valign="top"></td><td valign="top"><em>mode</em> </td><td>The mode character to set or unset </td></tr>
573 <tr><td valign="top"></td><td valign="top"><em>parameter</em> </td><td>The parameter string to associate with this mode character </td></tr>
574 <tr><td valign="top"></td><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>
579 Definition at line <a class="el" href="channels_8cpp-source.html#l00138">138</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
581 References <a class="el" href="channels_8h-source.html#l00082">ModeParameter::channel</a>, <a class="el" href="channels_8cpp-source.html#l00099">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>.
583 Referenced by <a class="el" href="channels_8cpp-source.html#l00113">SetCustomMode()</a>.<div class="fragment"><pre class="fragment"><a name="l00139"></a>00139 {
584 <a name="l00140"></a>00140
585 <a name="l00141"></a>00141 log(<a class="code" href="modules_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"SetCustomModeParam called"</span>);
586 <a name="l00142"></a>00142 <a class="code" href="classModeParameter.html">ModeParameter</a> M;
587 <a name="l00143"></a>00143 M.<a class="code" href="classModeParameter.html#mode">mode</a> = mode;
588 <a name="l00144"></a>00144 strlcpy(M.<a class="code" href="classModeParameter.html#channel_5BCHANMAX_5D">channel</a>,this->name,CHANMAX);
589 <a name="l00145"></a>00145 strlcpy(M.<a class="code" href="classModeParameter.html#parameter_5BMAXBUF_5D">parameter</a>,parameter,MAXBUF);
590 <a name="l00146"></a>00146 <span class="keywordflow">if</span> (mode_on)
591 <a name="l00147"></a>00147 {
592 <a name="l00148"></a>00148 log(<a class="code" href="modules_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"Custom mode parameter %c %s added"</span>,mode,parameter);
593 <a name="l00149"></a>00149 <a class="code" href="channels_8cpp.html#custom_5Fmode_5Fparams">custom_mode_params</a>.push_back(M);
594 <a name="l00150"></a>00150 }
595 <a name="l00151"></a>00151 <span class="keywordflow">else</span>
596 <a name="l00152"></a>00152 {
597 <a name="l00153"></a>00153 <span class="keywordflow">if</span> (<a class="code" href="channels_8cpp.html#custom_5Fmode_5Fparams">custom_mode_params</a>.size())
598 <a name="l00154"></a>00154 {
599 <a name="l00155"></a>00155 <span class="keywordflow">for</span> (vector<ModeParameter>::iterator i = <a class="code" href="channels_8cpp.html#custom_5Fmode_5Fparams">custom_mode_params</a>.begin(); i < <a class="code" href="channels_8cpp.html#custom_5Fmode_5Fparams">custom_mode_params</a>.end(); i++)
600 <a name="l00156"></a>00156 {
601 <a name="l00157"></a>00157 <span class="keywordflow">if</span> ((i->mode == mode) && (!strcasecmp(this->name,i->channel)))
602 <a name="l00158"></a>00158 {
603 <a name="l00159"></a>00159 log(<a class="code" href="modules_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"Custom mode parameter %c %s removed"</span>,mode,parameter);
604 <a name="l00160"></a>00160 <a class="code" href="channels_8cpp.html#custom_5Fmode_5Fparams">custom_mode_params</a>.erase(i);
605 <a name="l00161"></a>00161 <span class="keywordflow">return</span>;
606 <a name="l00162"></a>00162 }
607 <a name="l00163"></a>00163 }
608 <a name="l00164"></a>00164 }
609 <a name="l00165"></a>00165 log(<a class="code" href="modules_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"*** BUG *** Attempt to remove non-existent mode parameter!"</span>);
610 <a name="l00166"></a>00166 }
611 <a name="l00167"></a>00167 }
617 <hr><h2>Member Data Documentation</h2>
618 <a class="anchor" name="bans"></a><!-- doxytag: member="chanrec::bans" ref="bans" args="" --><p>
619 <table class="mdTable" cellpadding="2" cellspacing="0">
622 <table cellpadding="0" cellspacing="0" border="0">
624 <td class="md" nowrap valign="top"><a class="el" href="channels_8h.html#BanList">BanList</a> <a class="el" href="classchanrec.html#bans">chanrec::bans</a> </td>
630 <table cellspacing="5" cellpadding="0" border="0">
638 The list of all bans set on the channel.
642 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>
645 <a class="anchor" name="binarymodes"></a><!-- doxytag: member="chanrec::binarymodes" ref="binarymodes" args="" --><p>
646 <table class="mdTable" cellpadding="2" cellspacing="0">
649 <table cellpadding="0" cellspacing="0" border="0">
651 <td class="md" nowrap valign="top">char <a class="el" href="classchanrec.html#binarymodes">chanrec::binarymodes</a> </td>
657 <table cellspacing="5" cellpadding="0" border="0">
665 Contains a bitmask of the CM_* builtin (RFC) binary mode symbols.
669 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>.
671 Referenced by <a class="el" href="channels_8cpp-source.html#l00101">chanrec()</a>. </td>
674 <a class="anchor" name="created"></a><!-- doxytag: member="chanrec::created" ref="created" args="" --><p>
675 <table class="mdTable" cellpadding="2" cellspacing="0">
678 <table cellpadding="0" cellspacing="0" border="0">
680 <td class="md" nowrap valign="top">time_t <a class="el" href="classchanrec.html#created">chanrec::created</a> </td>
686 <table cellspacing="5" cellpadding="0" border="0">
698 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>.
700 Referenced by <a class="el" href="channels_8cpp-source.html#l00101">chanrec()</a>. </td>
703 <a class="anchor" name="custom_5Fmodes_5BMAXMODES_5D"></a><!-- doxytag: member="chanrec::custom_modes" ref="custom_5Fmodes_5BMAXMODES_5D" args="[MAXMODES]" --><p>
704 <table class="mdTable" cellpadding="2" cellspacing="0">
707 <table cellpadding="0" cellspacing="0" border="0">
709 <td class="md" nowrap valign="top">char <a class="el" href="classchanrec.html#custom_5Fmodes_5BMAXMODES_5D">chanrec::custom_modes</a>[MAXMODES] </td>
715 <table cellspacing="5" cellpadding="0" border="0">
723 Custom modes for the channel.
725 Plugins may use this field in any way they see fit.
727 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>.
729 Referenced by <a class="el" href="channels_8cpp-source.html#l00101">chanrec()</a>, and <a class="el" href="channels_8cpp-source.html#l00113">SetCustomMode()</a>. </td>
732 <a class="anchor" name="internal_5Fuserlist"></a><!-- doxytag: member="chanrec::internal_userlist" ref="internal_5Fuserlist" args="" --><p>
733 <table class="mdTable" cellpadding="2" cellspacing="0">
736 <table cellpadding="0" cellspacing="0" border="0">
738 <td class="md" nowrap valign="top">std::vector<char*> <a class="el" href="classchanrec.html#internal_5Fuserlist">chanrec::internal_userlist</a> </td>
744 <table cellspacing="5" cellpadding="0" border="0">
752 User list (casted to char*'s to stop forward declaration stuff) (chicken and egg scenario!).
756 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>.
758 Referenced by <a class="el" href="channels_8cpp-source.html#l00195">AddUser()</a>, <a class="el" href="channels_8cpp-source.html#l00101">chanrec()</a>, <a class="el" href="channels_8cpp-source.html#l00201">DelUser()</a>, and <a class="el" href="channels_8cpp-source.html#l00215">GetUsers()</a>. </td>
761 <a class="anchor" name="key_5B_33_32_5D"></a><!-- doxytag: member="chanrec::key" ref="key_5B_33_32_5D" args="[32]" --><p>
762 <table class="mdTable" cellpadding="2" cellspacing="0">
765 <table cellpadding="0" cellspacing="0" border="0">
767 <td class="md" nowrap valign="top">char <a class="el" href="classchanrec.html#key_5B_33_32_5D">chanrec::key</a>[32] </td>
773 <table cellspacing="5" cellpadding="0" border="0">
781 Contains the channel key.
783 If this value is an empty string, there is no channel key in place.
785 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>.
787 Referenced by <a class="el" href="channels_8cpp-source.html#l00101">chanrec()</a>. </td>
790 <a class="anchor" name="limit"></a><!-- doxytag: member="chanrec::limit" ref="limit" args="" --><p>
791 <table class="mdTable" cellpadding="2" cellspacing="0">
794 <table cellpadding="0" cellspacing="0" border="0">
796 <td class="md" nowrap valign="top">short int <a class="el" href="classchanrec.html#limit">chanrec::limit</a> </td>
802 <table cellspacing="5" cellpadding="0" border="0">
810 Contains the channel user limit.
812 If this value is zero, there is no limit in place.
814 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>.
816 Referenced by <a class="el" href="channels_8cpp-source.html#l00101">chanrec()</a>. </td>
819 <a class="anchor" name="name_5BCHANMAX_5D"></a><!-- doxytag: member="chanrec::name" ref="name_5BCHANMAX_5D" args="[CHANMAX]" --><p>
820 <table class="mdTable" cellpadding="2" cellspacing="0">
823 <table cellpadding="0" cellspacing="0" border="0">
825 <td class="md" nowrap valign="top">char <a class="el" href="classchanrec.html#name_5BCHANMAX_5D">chanrec::name</a>[CHANMAX] </td>
831 <table cellspacing="5" cellpadding="0" border="0">
843 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>.
845 Referenced by <a class="el" href="channels_8cpp-source.html#l00101">chanrec()</a>, <a class="el" href="channels_8cpp-source.html#l00201">DelUser()</a>, and <a class="el" href="modules_8cpp-source.html#l00708">Server::PseudoToUser()</a>. </td>
848 <a class="anchor" name="setby_5BNICKMAX_5D"></a><!-- doxytag: member="chanrec::setby" ref="setby_5BNICKMAX_5D" args="[NICKMAX]" --><p>
849 <table class="mdTable" cellpadding="2" cellspacing="0">
852 <table cellpadding="0" cellspacing="0" border="0">
854 <td class="md" nowrap valign="top">char <a class="el" href="classchanrec.html#setby_5BNICKMAX_5D">chanrec::setby</a>[NICKMAX] </td>
860 <table cellspacing="5" cellpadding="0" border="0">
868 The last user to set the topic.
870 If this member is an empty string, no topic was ever set.
872 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>.
874 Referenced by <a class="el" href="channels_8cpp-source.html#l00101">chanrec()</a>, and <a class="el" href="modules_8cpp-source.html#l00708">Server::PseudoToUser()</a>. </td>
877 <a class="anchor" name="topic_5BMAXBUF_5D"></a><!-- doxytag: member="chanrec::topic" ref="topic_5BMAXBUF_5D" args="[MAXBUF]" --><p>
878 <table class="mdTable" cellpadding="2" cellspacing="0">
881 <table cellpadding="0" cellspacing="0" border="0">
883 <td class="md" nowrap valign="top">char <a class="el" href="classchanrec.html#topic_5BMAXBUF_5D">chanrec::topic</a>[MAXBUF] </td>
889 <table cellspacing="5" cellpadding="0" border="0">
899 If this is an empty string, no channel topic is set.
901 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>.
903 Referenced by <a class="el" href="channels_8cpp-source.html#l00101">chanrec()</a>, and <a class="el" href="modules_8cpp-source.html#l00708">Server::PseudoToUser()</a>. </td>
906 <a class="anchor" name="topicset"></a><!-- doxytag: member="chanrec::topicset" ref="topicset" args="" --><p>
907 <table class="mdTable" cellpadding="2" cellspacing="0">
910 <table cellpadding="0" cellspacing="0" border="0">
912 <td class="md" nowrap valign="top">time_t <a class="el" href="classchanrec.html#topicset">chanrec::topicset</a> </td>
918 <table cellspacing="5" cellpadding="0" border="0">
928 If no topic was ever set, this will be equal to <a class="el" href="classchanrec.html#created">chanrec::created</a>
930 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>.
932 Referenced by <a class="el" href="channels_8cpp-source.html#l00101">chanrec()</a>, and <a class="el" href="modules_8cpp-source.html#l00708">Server::PseudoToUser()</a>. </td>
935 <hr>The documentation for this class was generated from the following files:<ul>
936 <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>
937 <hr size="1"><address style="align: right;"><small>Generated on Fri Dec 9 20:20:11 2005 for InspIRCd by
938 <a href="http://www.doxygen.org/index.html">
939 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.4-20050815 </small></address>