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#l00073">73</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="l00074"></a>00074 {
129 <a name="l00075"></a>00075 strcpy(<a class="code" href="classchanrec.html#name_5BCHANMAX_5D">name</a>,<span class="stringliteral">""</span>);
130 <a name="l00076"></a>00076 strcpy(<a class="code" href="classchanrec.html#custom_5Fmodes_5BMAXMODES_5D">custom_modes</a>,<span class="stringliteral">""</span>);
131 <a name="l00077"></a>00077 strcpy(<a class="code" href="classchanrec.html#topic_5BMAXBUF_5D">topic</a>,<span class="stringliteral">""</span>);
132 <a name="l00078"></a>00078 strcpy(<a class="code" href="classchanrec.html#setby_5BNICKMAX_5D">setby</a>,<span class="stringliteral">""</span>);
133 <a name="l00079"></a>00079 strcpy(<a class="code" href="classchanrec.html#key_5B_33_32_5D">key</a>,<span class="stringliteral">""</span>);
134 <a name="l00080"></a>00080 <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="l00081"></a>00081 <a class="code" href="classchanrec.html#binarymodes">binarymodes</a> = 0;
136 <a name="l00082"></a>00082 <a class="code" href="classchanrec.html#internal_5Fuserlist">internal_userlist</a>.clear();
137 <a name="l00083"></a>00083 }
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#l00166">166</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
212 References <a class="el" href="inspircd__io_8h-source.html#l00028">DEBUG</a>, and <a class="el" href="channels_8h-source.html#l00115">internal_userlist</a>.<div class="fragment"><pre class="fragment"><a name="l00167"></a>00167 {
213 <a name="l00168"></a>00168 <a class="code" href="classchanrec.html#internal_5Fuserlist">internal_userlist</a>.push_back(castuser);
214 <a name="l00169"></a>00169 log(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"Added casted user to channel's internal list"</span>);
215 <a name="l00170"></a>00170 }
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#l00172">172</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
257 References <a class="el" href="inspircd__io_8h-source.html#l00028">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="l00173"></a>00173 {
258 <a name="l00174"></a>00174 <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="l00175"></a>00175 {
260 <a name="l00176"></a>00176 <span class="keywordflow">if</span> (*a == castuser)
261 <a name="l00177"></a>00177 {
262 <a name="l00178"></a>00178 log(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"Removed casted user from channel's internal list"</span>);
263 <a name="l00179"></a>00179 <a class="code" href="classchanrec.html#internal_5Fuserlist">internal_userlist</a>.erase(a);
264 <a name="l00180"></a>00180 <span class="keywordflow">return</span>;
265 <a name="l00181"></a>00181 }
266 <a name="l00182"></a>00182 }
267 <a name="l00183"></a>00183 log(<a class="code" href="inspircd__io_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="l00184"></a>00184 }
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#l00146">146</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
312 References <a class="el" href="channels_8cpp-source.html#l00071">custom_mode_params</a>.<div class="fragment"><pre class="fragment"><a name="l00147"></a>00147 {
313 <a name="l00148"></a>00148 <span class="keywordflow">if</span> (<a class="code" href="channels_8cpp.html#custom_5Fmode_5Fparams">custom_mode_params</a>.size())
314 <a name="l00149"></a>00149 {
315 <a name="l00150"></a>00150 <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="l00151"></a>00151 {
317 <a name="l00152"></a>00152 <span class="keywordflow">if</span> ((i->mode == mode) && (!strcasecmp(this->name,i->channel)))
318 <a name="l00153"></a>00153 {
319 <a name="l00154"></a>00154 <span class="keywordflow">return</span> i->parameter;
320 <a name="l00155"></a>00155 }
321 <a name="l00156"></a>00156 }
322 <a name="l00157"></a>00157 }
323 <a name="l00158"></a>00158 <span class="keywordflow">return</span> <span class="stringliteral">""</span>;
324 <a name="l00159"></a>00159 }
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#l00161">161</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.<div class="fragment"><pre class="fragment"><a name="l00162"></a>00162 {
360 <a name="l00163"></a>00163 <span class="keywordflow">return</span> (this->internal_userlist.size());
361 <a name="l00164"></a>00164 }
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#l00186">186</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#l00377">Server::GetUsers()</a>.<div class="fragment"><pre class="fragment"><a name="l00187"></a>00187 {
402 <a name="l00188"></a>00188 <span class="keywordflow">return</span> &<a class="code" href="classchanrec.html#internal_5Fuserlist">internal_userlist</a>;
403 <a name="l00189"></a>00189 }
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#l00141">141</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.<div class="fragment"><pre class="fragment"><a name="l00142"></a>00142 {
445 <a name="l00143"></a>00143 <span class="keywordflow">return</span> (strchr(this->custom_modes,mode));
446 <a name="l00144"></a>00144 }
452 <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>
453 <table class="mdTable" cellpadding="2" cellspacing="0">
456 <table cellpadding="0" cellspacing="0" border="0">
458 <td class="md" nowrap valign="top">void chanrec::SetCustomMode </td>
459 <td class="md" valign="top">( </td>
460 <td class="md" nowrap valign="top">char </td>
461 <td class="mdname" nowrap> <em>mode</em>, </td>
464 <td class="md" nowrap align="right"></td>
466 <td class="md" nowrap>bool </td>
467 <td class="mdname" nowrap> <em>mode_on</em></td>
471 <td class="md">) </td>
472 <td class="md" colspan="2"></td>
478 <table cellspacing="5" cellpadding="0" border="0">
486 Sets or unsets a custom mode in the channels info.
488 <dl compact><dt><b>Parameters:</b></dt><dd>
489 <table border="0" cellspacing="2" cellpadding="0">
490 <tr><td valign="top"></td><td valign="top"><em>mode</em> </td><td>The mode character to set or unset </td></tr>
491 <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>
496 Definition at line <a class="el" href="channels_8cpp-source.html#l00085">85</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
498 References <a class="el" href="channels_8h-source.html#l00110">custom_modes</a>, <a class="el" href="inspircd__io_8h-source.html#l00028">DEBUG</a>, and <a class="el" href="channels_8cpp-source.html#l00110">SetCustomModeParam()</a>.<div class="fragment"><pre class="fragment"><a name="l00086"></a>00086 {
499 <a name="l00087"></a>00087 <span class="keywordflow">if</span> (mode_on) {
500 <a name="l00088"></a>00088 <span class="keyword">static</span> <span class="keywordtype">char</span> m[3];
501 <a name="l00089"></a>00089 m[0] = mode;
502 <a name="l00090"></a>00090 m[1] = <span class="charliteral">'\0'</span>;
503 <a name="l00091"></a>00091 <span class="keywordflow">if</span> (!strchr(this->custom_modes,mode))
504 <a name="l00092"></a>00092 {
505 <a name="l00093"></a>00093 strlcat(<a class="code" href="classchanrec.html#custom_5Fmodes_5BMAXMODES_5D">custom_modes</a>,m,MAXMODES);
506 <a name="l00094"></a>00094 }
507 <a name="l00095"></a>00095 log(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"Custom mode %c set"</span>,mode);
508 <a name="l00096"></a>00096 }
509 <a name="l00097"></a>00097 <span class="keywordflow">else</span> {
510 <a name="l00098"></a>00098
511 <a name="l00099"></a>00099 <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>;
512 <a name="l00100"></a>00100 <span class="keywordtype">int</span> pos = a.find(mode);
513 <a name="l00101"></a>00101 a.erase(pos,1);
514 <a name="l00102"></a>00102 strncpy(this->custom_modes,a.c_str(),MAXMODES);
515 <a name="l00103"></a>00103
516 <a name="l00104"></a>00104 log(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"Custom mode %c removed: modelist='%s'"</span>,mode,this->custom_modes);
517 <a name="l00105"></a>00105 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>);
518 <a name="l00106"></a>00106 }
519 <a name="l00107"></a>00107 }
525 <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>
526 <table class="mdTable" cellpadding="2" cellspacing="0">
529 <table cellpadding="0" cellspacing="0" border="0">
531 <td class="md" nowrap valign="top">void chanrec::SetCustomModeParam </td>
532 <td class="md" valign="top">( </td>
533 <td class="md" nowrap valign="top">char </td>
534 <td class="mdname" nowrap> <em>mode</em>, </td>
537 <td class="md" nowrap align="right"></td>
539 <td class="md" nowrap>char * </td>
540 <td class="mdname" nowrap> <em>parameter</em>, </td>
543 <td class="md" nowrap align="right"></td>
545 <td class="md" nowrap>bool </td>
546 <td class="mdname" nowrap> <em>mode_on</em></td>
550 <td class="md">) </td>
551 <td class="md" colspan="2"></td>
557 <table cellspacing="5" cellpadding="0" border="0">
565 Sets or unsets the parameters for a custom mode in a channels info.
567 <dl compact><dt><b>Parameters:</b></dt><dd>
568 <table border="0" cellspacing="2" cellpadding="0">
569 <tr><td valign="top"></td><td valign="top"><em>mode</em> </td><td>The mode character to set or unset </td></tr>
570 <tr><td valign="top"></td><td valign="top"><em>parameter</em> </td><td>The parameter string to associate with this mode character </td></tr>
571 <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>
576 Definition at line <a class="el" href="channels_8cpp-source.html#l00110">110</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
578 References <a class="el" href="channels_8h-source.html#l00082">ModeParameter::channel</a>, <a class="el" href="channels_8cpp-source.html#l00071">custom_mode_params</a>, <a class="el" href="inspircd__io_8h-source.html#l00028">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>.
580 Referenced by <a class="el" href="channels_8cpp-source.html#l00085">SetCustomMode()</a>.<div class="fragment"><pre class="fragment"><a name="l00111"></a>00111 {
581 <a name="l00112"></a>00112
582 <a name="l00113"></a>00113 log(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"SetCustomModeParam called"</span>);
583 <a name="l00114"></a>00114 <a class="code" href="classModeParameter.html">ModeParameter</a> M;
584 <a name="l00115"></a>00115 M.<a class="code" href="classModeParameter.html#mode">mode</a> = mode;
585 <a name="l00116"></a>00116 strlcpy(M.<a class="code" href="classModeParameter.html#channel_5BCHANMAX_5D">channel</a>,this->name,CHANMAX);
586 <a name="l00117"></a>00117 strlcpy(M.<a class="code" href="classModeParameter.html#parameter_5BMAXBUF_5D">parameter</a>,parameter,MAXBUF);
587 <a name="l00118"></a>00118 <span class="keywordflow">if</span> (mode_on)
588 <a name="l00119"></a>00119 {
589 <a name="l00120"></a>00120 log(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"Custom mode parameter %c %s added"</span>,mode,parameter);
590 <a name="l00121"></a>00121 <a class="code" href="channels_8cpp.html#custom_5Fmode_5Fparams">custom_mode_params</a>.push_back(M);
591 <a name="l00122"></a>00122 }
592 <a name="l00123"></a>00123 <span class="keywordflow">else</span>
593 <a name="l00124"></a>00124 {
594 <a name="l00125"></a>00125 <span class="keywordflow">if</span> (<a class="code" href="channels_8cpp.html#custom_5Fmode_5Fparams">custom_mode_params</a>.size())
595 <a name="l00126"></a>00126 {
596 <a name="l00127"></a>00127 <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++)
597 <a name="l00128"></a>00128 {
598 <a name="l00129"></a>00129 <span class="keywordflow">if</span> ((i->mode == mode) && (!strcasecmp(this->name,i->channel)))
599 <a name="l00130"></a>00130 {
600 <a name="l00131"></a>00131 log(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"Custom mode parameter %c %s removed"</span>,mode,parameter);
601 <a name="l00132"></a>00132 <a class="code" href="channels_8cpp.html#custom_5Fmode_5Fparams">custom_mode_params</a>.erase(i);
602 <a name="l00133"></a>00133 <span class="keywordflow">return</span>;
603 <a name="l00134"></a>00134 }
604 <a name="l00135"></a>00135 }
605 <a name="l00136"></a>00136 }
606 <a name="l00137"></a>00137 log(<a class="code" href="inspircd__io_8h.html#DEBUG">DEBUG</a>,<span class="stringliteral">"*** BUG *** Attempt to remove non-existent mode parameter!"</span>);
607 <a name="l00138"></a>00138 }
608 <a name="l00139"></a>00139 }
614 <hr><h2>Member Data Documentation</h2>
615 <a class="anchor" name="bans"></a><!-- doxytag: member="chanrec::bans" ref="bans" args="" --><p>
616 <table class="mdTable" cellpadding="2" cellspacing="0">
619 <table cellpadding="0" cellspacing="0" border="0">
621 <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>
627 <table cellspacing="5" cellpadding="0" border="0">
635 The list of all bans set on the channel.
639 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>
642 <a class="anchor" name="binarymodes"></a><!-- doxytag: member="chanrec::binarymodes" ref="binarymodes" args="" --><p>
643 <table class="mdTable" cellpadding="2" cellspacing="0">
646 <table cellpadding="0" cellspacing="0" border="0">
648 <td class="md" nowrap valign="top">char <a class="el" href="classchanrec.html#binarymodes">chanrec::binarymodes</a> </td>
654 <table cellspacing="5" cellpadding="0" border="0">
662 Contains a bitmask of the CM_* builtin (RFC) binary mode symbols.
666 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>.
668 Referenced by <a class="el" href="channels_8cpp-source.html#l00073">chanrec()</a>. </td>
671 <a class="anchor" name="created"></a><!-- doxytag: member="chanrec::created" ref="created" args="" --><p>
672 <table class="mdTable" cellpadding="2" cellspacing="0">
675 <table cellpadding="0" cellspacing="0" border="0">
677 <td class="md" nowrap valign="top">time_t <a class="el" href="classchanrec.html#created">chanrec::created</a> </td>
683 <table cellspacing="5" cellpadding="0" border="0">
695 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>.
697 Referenced by <a class="el" href="channels_8cpp-source.html#l00073">chanrec()</a>. </td>
700 <a class="anchor" name="custom_5Fmodes_5BMAXMODES_5D"></a><!-- doxytag: member="chanrec::custom_modes" ref="custom_5Fmodes_5BMAXMODES_5D" args="[MAXMODES]" --><p>
701 <table class="mdTable" cellpadding="2" cellspacing="0">
704 <table cellpadding="0" cellspacing="0" border="0">
706 <td class="md" nowrap valign="top">char <a class="el" href="classchanrec.html#custom_5Fmodes_5BMAXMODES_5D">chanrec::custom_modes</a>[MAXMODES] </td>
712 <table cellspacing="5" cellpadding="0" border="0">
720 Custom modes for the channel.
722 Plugins may use this field in any way they see fit.
724 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>.
726 Referenced by <a class="el" href="channels_8cpp-source.html#l00073">chanrec()</a>, and <a class="el" href="channels_8cpp-source.html#l00085">SetCustomMode()</a>. </td>
729 <a class="anchor" name="internal_5Fuserlist"></a><!-- doxytag: member="chanrec::internal_userlist" ref="internal_5Fuserlist" args="" --><p>
730 <table class="mdTable" cellpadding="2" cellspacing="0">
733 <table cellpadding="0" cellspacing="0" border="0">
735 <td class="md" nowrap valign="top">std::vector<char*> <a class="el" href="classchanrec.html#internal_5Fuserlist">chanrec::internal_userlist</a> </td>
741 <table cellspacing="5" cellpadding="0" border="0">
749 User list (casted to char*'s to stop forward declaration stuff) (chicken and egg scenario!).
753 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>.
755 Referenced by <a class="el" href="channels_8cpp-source.html#l00166">AddUser()</a>, <a class="el" href="channels_8cpp-source.html#l00073">chanrec()</a>, <a class="el" href="channels_8cpp-source.html#l00172">DelUser()</a>, and <a class="el" href="channels_8cpp-source.html#l00186">GetUsers()</a>. </td>
758 <a class="anchor" name="key_5B_33_32_5D"></a><!-- doxytag: member="chanrec::key" ref="key_5B_33_32_5D" args="[32]" --><p>
759 <table class="mdTable" cellpadding="2" cellspacing="0">
762 <table cellpadding="0" cellspacing="0" border="0">
764 <td class="md" nowrap valign="top">char <a class="el" href="classchanrec.html#key_5B_33_32_5D">chanrec::key</a>[32] </td>
770 <table cellspacing="5" cellpadding="0" border="0">
778 Contains the channel key.
780 If this value is an empty string, there is no channel key in place.
782 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>.
784 Referenced by <a class="el" href="channels_8cpp-source.html#l00073">chanrec()</a>. </td>
787 <a class="anchor" name="limit"></a><!-- doxytag: member="chanrec::limit" ref="limit" args="" --><p>
788 <table class="mdTable" cellpadding="2" cellspacing="0">
791 <table cellpadding="0" cellspacing="0" border="0">
793 <td class="md" nowrap valign="top">short int <a class="el" href="classchanrec.html#limit">chanrec::limit</a> </td>
799 <table cellspacing="5" cellpadding="0" border="0">
807 Contains the channel user limit.
809 If this value is zero, there is no limit in place.
811 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>.
813 Referenced by <a class="el" href="channels_8cpp-source.html#l00073">chanrec()</a>. </td>
816 <a class="anchor" name="name_5BCHANMAX_5D"></a><!-- doxytag: member="chanrec::name" ref="name_5BCHANMAX_5D" args="[CHANMAX]" --><p>
817 <table class="mdTable" cellpadding="2" cellspacing="0">
820 <table cellpadding="0" cellspacing="0" border="0">
822 <td class="md" nowrap valign="top">char <a class="el" href="classchanrec.html#name_5BCHANMAX_5D">chanrec::name</a>[CHANMAX] </td>
828 <table cellspacing="5" cellpadding="0" border="0">
840 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>.
842 Referenced by <a class="el" href="channels_8cpp-source.html#l00073">chanrec()</a>, <a class="el" href="channels_8cpp-source.html#l00172">DelUser()</a>, and <a class="el" href="modules_8cpp-source.html#l00613">Server::PseudoToUser()</a>. </td>
845 <a class="anchor" name="setby_5BNICKMAX_5D"></a><!-- doxytag: member="chanrec::setby" ref="setby_5BNICKMAX_5D" args="[NICKMAX]" --><p>
846 <table class="mdTable" cellpadding="2" cellspacing="0">
849 <table cellpadding="0" cellspacing="0" border="0">
851 <td class="md" nowrap valign="top">char <a class="el" href="classchanrec.html#setby_5BNICKMAX_5D">chanrec::setby</a>[NICKMAX] </td>
857 <table cellspacing="5" cellpadding="0" border="0">
865 The last user to set the topic.
867 If this member is an empty string, no topic was ever set.
869 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>.
871 Referenced by <a class="el" href="channels_8cpp-source.html#l00073">chanrec()</a>, and <a class="el" href="modules_8cpp-source.html#l00613">Server::PseudoToUser()</a>. </td>
874 <a class="anchor" name="topic_5BMAXBUF_5D"></a><!-- doxytag: member="chanrec::topic" ref="topic_5BMAXBUF_5D" args="[MAXBUF]" --><p>
875 <table class="mdTable" cellpadding="2" cellspacing="0">
878 <table cellpadding="0" cellspacing="0" border="0">
880 <td class="md" nowrap valign="top">char <a class="el" href="classchanrec.html#topic_5BMAXBUF_5D">chanrec::topic</a>[MAXBUF] </td>
886 <table cellspacing="5" cellpadding="0" border="0">
896 If this is an empty string, no channel topic is set.
898 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>.
900 Referenced by <a class="el" href="channels_8cpp-source.html#l00073">chanrec()</a>, and <a class="el" href="modules_8cpp-source.html#l00613">Server::PseudoToUser()</a>. </td>
903 <a class="anchor" name="topicset"></a><!-- doxytag: member="chanrec::topicset" ref="topicset" args="" --><p>
904 <table class="mdTable" cellpadding="2" cellspacing="0">
907 <table cellpadding="0" cellspacing="0" border="0">
909 <td class="md" nowrap valign="top">time_t <a class="el" href="classchanrec.html#topicset">chanrec::topicset</a> </td>
915 <table cellspacing="5" cellpadding="0" border="0">
925 If no topic was ever set, this will be equal to <a class="el" href="classchanrec.html#created">chanrec::created</a>
927 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>.
929 Referenced by <a class="el" href="channels_8cpp-source.html#l00073">chanrec()</a>, and <a class="el" href="modules_8cpp-source.html#l00613">Server::PseudoToUser()</a>. </td>
932 <hr>The documentation for this class was generated from the following files:<ul>
933 <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>
934 <hr size="1"><address style="align: right;"><small>Generated on Wed Dec 14 15:55:48 2005 for InspIRCd by
935 <a href="http://www.doxygen.org/index.html">
936 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.4-20050815 </small></address>