1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3 <title>InspIRCd: chanrec class Reference</title>
4 <link href="inspircd.css" rel="stylesheet" type="text/css">
6 <!-- Generated by Doxygen 1.3.3 -->
7 <div class="qindex"><a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Compound List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Compound Members</a> | <a class="qindex" href="globals.html">File Members</a></div>
8 <h1>chanrec Class Reference</h1>Holds all relevent information for a channel.
9 <a href="#_details">More...</a>
11 <code>#include <<a class="el" href="channels_8h-source.html">channels.h</a>></code>
13 Inherits <a class="el" href="classExtensible.html">Extensible</a>.
15 <a href="classchanrec-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
17 <tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
18 <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#a0">SetCustomMode</a> (char mode, bool mode_on)</td></tr>
20 <tr><td class="mdescLeft"> </td><td class="mdescRight">Sets or unsets a custom mode in the channels info. </em> <a href="#a0"></a><em><br><br></td></tr>
21 <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#a1">SetCustomModeParam</a> (char mode, char *parameter, bool mode_on)</td></tr>
23 <tr><td class="mdescLeft"> </td><td class="mdescRight">Sets or unsets the parameters for a custom mode in a channels info. </em> <a href="#a1"></a><em><br><br></td></tr>
24 <tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#a2">IsCustomModeSet</a> (char mode)</td></tr>
26 <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns true if a custom mode is set on a channel. </em> <a href="#a2"></a><em><br><br></td></tr>
27 <tr><td class="memItemLeft" nowrap align=right valign=top>std::string </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#a3">GetModeParameter</a> (char mode)</td></tr>
29 <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the parameter for a custom mode on a channel. </em> <a href="#a3"></a><em><br><br></td></tr>
30 <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#a4">IncUserCounter</a> ()</td></tr>
32 <tr><td class="mdescLeft"> </td><td class="mdescRight">Increment the channel "user counter" The channel user counter is a reference counter which holds the number of users on the channel. </em> <a href="#a4"></a><em><br><br></td></tr>
33 <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#a5">DecUserCounter</a> ()</td></tr>
35 <tr><td class="mdescLeft"> </td><td class="mdescRight">Decrement the channel "user counter" The channel user counter is a reference counter which holds the number of users on the channel. </em> <a href="#a5"></a><em><br><br></td></tr>
36 <tr><td class="memItemLeft" nowrap align=right valign=top>long </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#a6">GetUserCounter</a> ()</td></tr>
38 <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="#a6"></a><em><br><br></td></tr>
39 <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#a7">AddUser</a> (char *castuser)</td></tr>
41 <tr><td class="mdescLeft"> </td><td class="mdescRight">Add a user pointer to the internal reference list The data inserted into the reference list is a table as it is an arbitary pointer compared to other users by its memory address, as this is a very fast 32 or 64 bit integer comparison. </em> <a href="#a7"></a><em><br><br></td></tr>
42 <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#a8">DelUser</a> (char *castuser)</td></tr>
44 <tr><td class="mdescLeft"> </td><td class="mdescRight">Delete a user pointer to the internal reference list The data removed from the reference list is a table as it is an arbitary pointer compared to other users by its memory address, as this is a very fast 32 or 64 bit integer comparison. </em> <a href="#a8"></a><em><br><br></td></tr>
45 <tr><td class="memItemLeft" nowrap align=right valign=top>std::vector< char * > * </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#a9">GetUsers</a> ()</td></tr>
47 <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="#a9"></a><em><br><br></td></tr>
48 <tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#a10">chanrec</a> ()</td></tr>
50 <tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a channel record and initialises it with default values. </em> <a href="#a10"></a><em><br><br></td></tr>
51 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#a11">~chanrec</a> ()</td></tr>
53 <tr><td colspan=2><br><h2>Public Attributes</h2></td></tr>
54 <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>
56 <tr><td class="mdescLeft"> </td><td class="mdescRight">The channels name. </em> <a href="#o0"></a><em><br><br></td></tr>
57 <tr><td class="memItemLeft" nowrap align=right valign=top>char </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o1">custom_modes</a> [MAXMODES]</td></tr>
59 <tr><td class="mdescLeft"> </td><td class="mdescRight">Custom modes for the channel. </em> <a href="#o1"></a><em><br><br></td></tr>
60 <tr><td class="memItemLeft" nowrap align=right valign=top>long </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o2">users</a></td></tr>
62 <tr><td class="mdescLeft"> </td><td class="mdescRight">Count of users on the channel used for fast user counting. </em> <a href="#o2"></a><em><br><br></td></tr>
63 <tr><td class="memItemLeft" nowrap align=right valign=top>std::vector< char * > </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o3">internal_userlist</a></td></tr>
65 <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="#o3"></a><em><br><br></td></tr>
66 <tr><td class="memItemLeft" nowrap align=right valign=top>char </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o4">topic</a> [MAXBUF]</td></tr>
68 <tr><td class="mdescLeft"> </td><td class="mdescRight">Channel topic. </em> <a href="#o4"></a><em><br><br></td></tr>
69 <tr><td class="memItemLeft" nowrap align=right valign=top>time_t </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o5">created</a></td></tr>
71 <tr><td class="mdescLeft"> </td><td class="mdescRight">Creation time. </em> <a href="#o5"></a><em><br><br></td></tr>
72 <tr><td class="memItemLeft" nowrap align=right valign=top>time_t </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o6">topicset</a></td></tr>
74 <tr><td class="mdescLeft"> </td><td class="mdescRight">Time topic was set. </em> <a href="#o6"></a><em><br><br></td></tr>
75 <tr><td class="memItemLeft" nowrap align=right valign=top>char </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o7">setby</a> [NICKMAX]</td></tr>
77 <tr><td class="mdescLeft"> </td><td class="mdescRight">The last user to set the topic. </em> <a href="#o7"></a><em><br><br></td></tr>
78 <tr><td class="memItemLeft" nowrap align=right valign=top>long </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o8">limit</a></td></tr>
80 <tr><td class="mdescLeft"> </td><td class="mdescRight">Contains the channel user limit. </em> <a href="#o8"></a><em><br><br></td></tr>
81 <tr><td class="memItemLeft" nowrap align=right valign=top>char </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o9">key</a> [32]</td></tr>
83 <tr><td class="mdescLeft"> </td><td class="mdescRight">Contains the channel key. </em> <a href="#o9"></a><em><br><br></td></tr>
84 <tr><td class="memItemLeft" nowrap align=right valign=top>short int </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o10">topiclock</a></td></tr>
86 <tr><td class="mdescLeft"> </td><td class="mdescRight">Nonzero if the mode +t is set. </em> <a href="#o10"></a><em><br><br></td></tr>
87 <tr><td class="memItemLeft" nowrap align=right valign=top>short int </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o11">noexternal</a></td></tr>
89 <tr><td class="mdescLeft"> </td><td class="mdescRight">Nonzero if the mode +n is set. </em> <a href="#o11"></a><em><br><br></td></tr>
90 <tr><td class="memItemLeft" nowrap align=right valign=top>short int </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o12">inviteonly</a></td></tr>
92 <tr><td class="mdescLeft"> </td><td class="mdescRight">Nonzero if the mode +i is set. </em> <a href="#o12"></a><em><br><br></td></tr>
93 <tr><td class="memItemLeft" nowrap align=right valign=top>short int </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o13">moderated</a></td></tr>
95 <tr><td class="mdescLeft"> </td><td class="mdescRight">Nonzero if the mode +m is set. </em> <a href="#o13"></a><em><br><br></td></tr>
96 <tr><td class="memItemLeft" nowrap align=right valign=top>short int </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o14">secret</a></td></tr>
98 <tr><td class="mdescLeft"> </td><td class="mdescRight">Nonzero if the mode +s is set. </em> <a href="#o14"></a><em><br><br></td></tr>
99 <tr><td class="memItemLeft" nowrap align=right valign=top>short int </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o15">c_private</a></td></tr>
101 <tr><td class="mdescLeft"> </td><td class="mdescRight">Nonzero if the mode +p is set. </em> <a href="#o15"></a><em><br><br></td></tr>
102 <tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="channels_8h.html#a5">BanList</a> </td><td class="memItemRight" valign=bottom><a class="el" href="classchanrec.html#o16">bans</a></td></tr>
104 <tr><td class="mdescLeft"> </td><td class="mdescRight">The list of all bans set on the channel. </em> <a href="#o16"></a><em><br><br></td></tr>
106 <hr><a name="_details"></a><h2>Detailed Description</h2>
107 Holds all relevent information for a channel.
109 This class represents a channel, and contains its name, modes, time created, topic, topic set time, etc, and an instance of the BanList type.
113 Definition at line <a class="el" href="channels_8h-source.html#l00094">94</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.<hr><h2>Constructor & Destructor Documentation</h2>
114 <a name="a10" doxytag="chanrec::chanrec"></a><p>
115 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
118 <table cellpadding="0" cellspacing="0" border="0">
120 <td class="md" nowrap valign="top"> chanrec::chanrec </td>
121 <td class="md" valign="top">( </td>
122 <td class="mdname1" valign="top" nowrap> </td>
123 <td class="md" valign="top"> ) </td>
124 <td class="md" nowrap></td>
131 <table cellspacing=5 cellpadding=0 border=0>
139 Creates a channel record and initialises it with default values.
143 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>.
145 References <a class="el" href="channels_8h-source.html#l00164">c_private</a>, <a class="el" href="channels_8h-source.html#l00120">created</a>, <a class="el" href="channels_8h-source.html#l00103">custom_modes</a>, <a class="el" href="channels_8h-source.html#l00112">internal_userlist</a>, <a class="el" href="channels_8h-source.html#l00150">inviteonly</a>, <a class="el" href="channels_8h-source.html#l00138">key</a>, <a class="el" href="channels_8h-source.html#l00133">limit</a>, <a class="el" href="channels_8h-source.html#l00154">moderated</a>, <a class="el" href="channels_8h-source.html#l00099">name</a>, <a class="el" href="channels_8h-source.html#l00146">noexternal</a>, <a class="el" href="channels_8h-source.html#l00159">secret</a>, <a class="el" href="channels_8h-source.html#l00128">setby</a>, <a class="el" href="channels_8h-source.html#l00117">topic</a>, <a class="el" href="channels_8h-source.html#l00142">topiclock</a>, <a class="el" href="channels_8h-source.html#l00124">topicset</a>, and <a class="el" href="channels_8h-source.html#l00107">users</a>.
147 <div class="fragment"><pre>00114 {
148 00115 strcpy(name,<span class="stringliteral">""</span>);
149 00116 strcpy(custom_modes,<span class="stringliteral">""</span>);
150 00117 strcpy(topic,<span class="stringliteral">""</span>);
151 00118 strcpy(setby,<span class="stringliteral">""</span>);
152 00119 strcpy(key,<span class="stringliteral">""</span>);
153 00120 <a class="code" href="classchanrec.html#o5">created</a> = <a class="code" href="classchanrec.html#o6">topicset</a> = <a class="code" href="classchanrec.html#o8">limit</a> = <a class="code" href="classchanrec.html#o2">users</a> = 0;
154 00121 <a class="code" href="classchanrec.html#o10">topiclock</a> = <a class="code" href="classchanrec.html#o11">noexternal</a> = <a class="code" href="classchanrec.html#o12">inviteonly</a> = <a class="code" href="classchanrec.html#o13">moderated</a> = <a class="code" href="classchanrec.html#o14">secret</a> = <a class="code" href="classchanrec.html#o15">c_private</a> = <span class="keyword">false</span>;
155 00122 <a class="code" href="classchanrec.html#o3">internal_userlist</a>.clear();
160 <a name="a11" doxytag="chanrec::~chanrec"></a><p>
161 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
164 <table cellpadding="0" cellspacing="0" border="0">
166 <td class="md" nowrap valign="top"> virtual chanrec::~<a class="el" href="classchanrec.html">chanrec</a> </td>
167 <td class="md" valign="top">( </td>
168 <td class="mdname1" valign="top" nowrap> </td>
169 <td class="md" valign="top"> ) </td>
170 <td class="md" nowrap><code> [inline, virtual]</code></td>
177 <table cellspacing=5 cellpadding=0 border=0>
187 Definition at line <a class="el" href="channels_8h-source.html#l00240">240</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.
189 <div class="fragment"><pre>00240 { <span class="comment">/* stub */</span> }
193 <hr><h2>Member Function Documentation</h2>
194 <a name="a7" doxytag="chanrec::AddUser"></a><p>
195 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
198 <table cellpadding="0" cellspacing="0" border="0">
200 <td class="md" nowrap valign="top"> void chanrec::AddUser </td>
201 <td class="md" valign="top">( </td>
202 <td class="md" nowrap valign="top">char * </td>
203 <td class="mdname1" valign="top" nowrap> <em>castuser</em> </td>
204 <td class="md" valign="top"> ) </td>
205 <td class="md" nowrap></td>
212 <table cellspacing=5 cellpadding=0 border=0>
220 Add a user pointer to the internal reference list The data inserted into the reference list is a table as it is an arbitary pointer compared to other users by its memory address, as this is a very fast 32 or 64 bit integer comparison.
224 Definition at line <a class="el" href="channels_8cpp-source.html#l00220">220</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
226 References <a class="el" href="modules_8h-source.html#l00023">DEBUG</a>, and <a class="el" href="channels_8h-source.html#l00112">internal_userlist</a>.
228 <div class="fragment"><pre>00221 {
229 00222 <a class="code" href="classchanrec.html#o3">internal_userlist</a>.push_back(castuser);
230 00223 log(DEBUG,<span class="stringliteral">"Added casted user to channel's internal list"</span>);
235 <a name="a5" doxytag="chanrec::DecUserCounter"></a><p>
236 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
239 <table cellpadding="0" cellspacing="0" border="0">
241 <td class="md" nowrap valign="top"> void chanrec::DecUserCounter </td>
242 <td class="md" valign="top">( </td>
243 <td class="mdname1" valign="top" nowrap> </td>
244 <td class="md" valign="top"> ) </td>
245 <td class="md" nowrap></td>
252 <table cellspacing=5 cellpadding=0 border=0>
260 Decrement the channel "user counter" The channel user counter is a reference counter which holds the number of users on the channel.
262 If it decremented to 0 then the channel is removed from the system. Modules may alter the reference count to hold channels open which have no users and would normally be deleted once empty.
264 Definition at line <a class="el" href="channels_8cpp-source.html#l00208">208</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
266 References <a class="el" href="modules_8h-source.html#l00023">DEBUG</a>, <a class="el" href="channels_8h-source.html#l00099">name</a>, and <a class="el" href="channels_8h-source.html#l00107">users</a>.
268 <div class="fragment"><pre>00209 {
269 00210 <span class="keywordflow">if</span> (this-><a class="code" href="classchanrec.html#o2">users</a> > 0)
270 00211 this-><a class="code" href="classchanrec.html#o2">users</a>--;
271 00212 log(DEBUG,<span class="stringliteral">"Decremented channel user count for %s to %lu"</span>,name,(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>)users);
276 <a name="a8" doxytag="chanrec::DelUser"></a><p>
277 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
280 <table cellpadding="0" cellspacing="0" border="0">
282 <td class="md" nowrap valign="top"> void chanrec::DelUser </td>
283 <td class="md" valign="top">( </td>
284 <td class="md" nowrap valign="top">char * </td>
285 <td class="mdname1" valign="top" nowrap> <em>castuser</em> </td>
286 <td class="md" valign="top"> ) </td>
287 <td class="md" nowrap></td>
294 <table cellspacing=5 cellpadding=0 border=0>
302 Delete a user pointer to the internal reference list The data removed from the reference list is a table as it is an arbitary pointer compared to other users by its memory address, as this is a very fast 32 or 64 bit integer comparison.
306 Definition at line <a class="el" href="channels_8cpp-source.html#l00226">226</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
308 References <a class="el" href="modules_8h-source.html#l00023">DEBUG</a>, <a class="el" href="channels_8h-source.html#l00112">internal_userlist</a>, and <a class="el" href="channels_8h-source.html#l00099">name</a>.
310 <div class="fragment"><pre>00227 {
311 00228 <span class="keywordflow">for</span> (std::vector<char*>::iterator a = <a class="code" href="classchanrec.html#o3">internal_userlist</a>.begin(); a < <a class="code" href="classchanrec.html#o3">internal_userlist</a>.end(); a++)
313 00230 <span class="keywordflow">if</span> (*a == castuser)
315 00232 log(DEBUG,<span class="stringliteral">"Removed casted user from channel's internal list"</span>);
316 00233 <a class="code" href="classchanrec.html#o3">internal_userlist</a>.erase(a);
317 00234 <span class="keywordflow">return</span>;
320 00237 log(DEBUG,<span class="stringliteral">"BUG BUG BUG! Attempt to remove an uncasted user from the internal list of %s!"</span>,name);
325 <a name="a3" doxytag="chanrec::GetModeParameter"></a><p>
326 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
329 <table cellpadding="0" cellspacing="0" border="0">
331 <td class="md" nowrap valign="top"> std::string chanrec::GetModeParameter </td>
332 <td class="md" valign="top">( </td>
333 <td class="md" nowrap valign="top">char </td>
334 <td class="mdname1" valign="top" nowrap> <em>mode</em> </td>
335 <td class="md" valign="top"> ) </td>
336 <td class="md" nowrap></td>
343 <table cellspacing=5 cellpadding=0 border=0>
351 Returns the parameter for a custom mode on a channel.
353 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.
355 Definition at line <a class="el" href="channels_8cpp-source.html#l00187">187</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
357 References <a class="el" href="channels_8cpp-source.html#l00111">custom_mode_params</a>.
359 <div class="fragment"><pre>00188 {
360 00189 <span class="keywordflow">if</span> (<a class="code" href="channels_8cpp.html#a38">custom_mode_params</a>.size())
362 00191 <span class="keywordflow">for</span> (vector<ModeParameter>::iterator i = <a class="code" href="channels_8cpp.html#a38">custom_mode_params</a>.begin(); i < <a class="code" href="channels_8cpp.html#a38">custom_mode_params</a>.end(); i++)
364 00193 <span class="keywordflow">if</span> ((i->mode == mode) && (!strcasecmp(this->name,i->channel)))
366 00195 <span class="keywordflow">return</span> std::string(i->parameter);
370 00199 <span class="keywordflow">return</span> std::string(<span class="stringliteral">""</span>);
375 <a name="a6" doxytag="chanrec::GetUserCounter"></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"> long chanrec::GetUserCounter </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 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.
404 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>.
406 References <a class="el" href="channels_8h-source.html#l00107">users</a>.
408 <div class="fragment"><pre>00216 {
409 00217 <span class="keywordflow">return</span> (this-><a class="code" href="classchanrec.html#o2">users</a>);
414 <a name="a9" doxytag="chanrec::GetUsers"></a><p>
415 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
418 <table cellpadding="0" cellspacing="0" border="0">
420 <td class="md" nowrap valign="top"> std::vector< char * > * chanrec::GetUsers </td>
421 <td class="md" valign="top">( </td>
422 <td class="mdname1" valign="top" nowrap> </td>
423 <td class="md" valign="top"> ) </td>
424 <td class="md" nowrap></td>
431 <table cellspacing=5 cellpadding=0 border=0>
439 Obrain the internal reference list The internal reference list contains a list of userrec* cast to char*.
441 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.
443 Definition at line <a class="el" href="channels_8cpp-source.html#l00240">240</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
445 References <a class="el" href="channels_8h-source.html#l00112">internal_userlist</a>.
447 <div class="fragment"><pre>00241 {
448 00242 <span class="keywordflow">return</span> &<a class="code" href="classchanrec.html#o3">internal_userlist</a>;
453 <a name="a4" doxytag="chanrec::IncUserCounter"></a><p>
454 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
457 <table cellpadding="0" cellspacing="0" border="0">
459 <td class="md" nowrap valign="top"> void chanrec::IncUserCounter </td>
460 <td class="md" valign="top">( </td>
461 <td class="mdname1" valign="top" nowrap> </td>
462 <td class="md" valign="top"> ) </td>
463 <td class="md" nowrap></td>
470 <table cellspacing=5 cellpadding=0 border=0>
478 Increment the channel "user counter" The channel user counter is a reference counter which holds the number of users on the channel.
480 If it decremented to 0 then the channel is removed from the system.
482 Definition at line <a class="el" href="channels_8cpp-source.html#l00202">202</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
484 References <a class="el" href="modules_8h-source.html#l00023">DEBUG</a>, <a class="el" href="channels_8h-source.html#l00099">name</a>, and <a class="el" href="channels_8h-source.html#l00107">users</a>.
486 <div class="fragment"><pre>00203 {
487 00204 this-><a class="code" href="classchanrec.html#o2">users</a>++;
488 00205 log(DEBUG,<span class="stringliteral">"Incremented channel user count for %s to %lu"</span>,name,(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>)users);
493 <a name="a2" doxytag="chanrec::IsCustomModeSet"></a><p>
494 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
497 <table cellpadding="0" cellspacing="0" border="0">
499 <td class="md" nowrap valign="top"> bool chanrec::IsCustomModeSet </td>
500 <td class="md" valign="top">( </td>
501 <td class="md" nowrap valign="top">char </td>
502 <td class="mdname1" valign="top" nowrap> <em>mode</em> </td>
503 <td class="md" valign="top"> ) </td>
504 <td class="md" nowrap></td>
511 <table cellspacing=5 cellpadding=0 border=0>
519 Returns true if a custom mode is set on a channel.
523 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>.
525 References <a class="el" href="modules_8h-source.html#l00023">DEBUG</a>.
527 <div class="fragment"><pre>00182 {
528 00183 log(DEBUG,<span class="stringliteral">"Checking ISCustomModeSet: %c %s"</span>,mode,this->custom_modes);
529 00184 <span class="keywordflow">return</span> (strchr(this->custom_modes,mode) != 0);
534 <a name="a0" doxytag="chanrec::SetCustomMode"></a><p>
535 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
538 <table cellpadding="0" cellspacing="0" border="0">
540 <td class="md" nowrap valign="top"> void chanrec::SetCustomMode </td>
541 <td class="md" valign="top">( </td>
542 <td class="md" nowrap valign="top">char </td>
543 <td class="mdname" nowrap> <em>mode</em>, </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>
561 <table cellspacing=5 cellpadding=0 border=0>
569 Sets or unsets a custom mode in the channels info.
573 Definition at line <a class="el" href="channels_8cpp-source.html#l00125">125</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
575 References <a class="el" href="channels_8h-source.html#l00103">custom_modes</a>, <a class="el" href="modules_8h-source.html#l00023">DEBUG</a>, and <a class="el" href="channels_8cpp-source.html#l00150">SetCustomModeParam()</a>.
577 <div class="fragment"><pre>00126 {
578 00127 <span class="keywordflow">if</span> (mode_on) {
579 00128 <span class="keywordtype">char</span> m[3];
581 00130 m[1] = <span class="charliteral">'\0'</span>;
582 00131 <span class="keywordflow">if</span> (!strchr(this->custom_modes,mode))
584 00133 strlcat(custom_modes,m,MAXMODES);
586 00135 log(DEBUG,<span class="stringliteral">"Custom mode %c set"</span>,mode);
588 00137 <span class="keywordflow">else</span> {
590 00139 std::string a = this-><a class="code" href="classchanrec.html#o1">custom_modes</a>;
591 00140 <span class="keywordtype">int</span> pos = a.find(mode);
592 00141 a.erase(pos,1);
593 00142 strncpy(this->custom_modes,a.c_str(),MAXMODES);
595 00144 log(DEBUG,<span class="stringliteral">"Custom mode %c removed: modelist='%s'"</span>,mode,this->custom_modes);
596 00145 this-><a class="code" href="classchanrec.html#a1">SetCustomModeParam</a>(mode,<span class="stringliteral">""</span>,<span class="keyword">false</span>);
602 <a name="a1" doxytag="chanrec::SetCustomModeParam"></a><p>
603 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
606 <table cellpadding="0" cellspacing="0" border="0">
608 <td class="md" nowrap valign="top"> void chanrec::SetCustomModeParam </td>
609 <td class="md" valign="top">( </td>
610 <td class="md" nowrap valign="top">char </td>
611 <td class="mdname" nowrap> <em>mode</em>, </td>
616 <td class="md" nowrap>char * </td>
617 <td class="mdname" nowrap> <em>parameter</em>, </td>
622 <td class="md" nowrap>bool </td>
623 <td class="mdname" nowrap> <em>mode_on</em></td>
627 <td class="md">) </td>
628 <td class="md" colspan="2"></td>
635 <table cellspacing=5 cellpadding=0 border=0>
643 Sets or unsets the parameters for a custom mode in a channels info.
647 Definition at line <a class="el" href="channels_8cpp-source.html#l00150">150</a> of file <a class="el" href="channels_8cpp-source.html">channels.cpp</a>.
649 References <a class="el" href="channels_8h-source.html#l00075">ModeParameter::channel</a>, <a class="el" href="channels_8cpp-source.html#l00111">custom_mode_params</a>, <a class="el" href="modules_8h-source.html#l00023">DEBUG</a>, <a class="el" href="channels_8h-source.html#l00073">ModeParameter::mode</a>, and <a class="el" href="channels_8h-source.html#l00074">ModeParameter::parameter</a>.
651 Referenced by <a class="el" href="channels_8cpp-source.html#l00125">SetCustomMode()</a>.
653 <div class="fragment"><pre>00151 {
655 00153 log(DEBUG,<span class="stringliteral">"SetCustomModeParam called"</span>);
656 00154 <a class="code" href="classModeParameter.html">ModeParameter</a> M;
657 00155 M.<a class="code" href="classModeParameter.html#o0">mode</a> = mode;
658 00156 strlcpy(M.<a class="code" href="classModeParameter.html#o2">channel</a>,this->name,CHANMAX);
659 00157 strlcpy(M.<a class="code" href="classModeParameter.html#o1">parameter</a>,parameter,MAXBUF);
660 00158 <span class="keywordflow">if</span> (mode_on)
662 00160 log(DEBUG,<span class="stringliteral">"Custom mode parameter %c %s added"</span>,mode,parameter);
663 00161 <a class="code" href="channels_8cpp.html#a38">custom_mode_params</a>.push_back(M);
665 00163 <span class="keywordflow">else</span>
667 00165 <span class="keywordflow">if</span> (<a class="code" href="channels_8cpp.html#a38">custom_mode_params</a>.size())
669 00167 <span class="keywordflow">for</span> (vector<ModeParameter>::iterator i = <a class="code" href="channels_8cpp.html#a38">custom_mode_params</a>.begin(); i < <a class="code" href="channels_8cpp.html#a38">custom_mode_params</a>.end(); i++)
671 00169 <span class="keywordflow">if</span> ((i->mode == mode) && (!strcasecmp(this->name,i->channel)))
673 00171 log(DEBUG,<span class="stringliteral">"Custom mode parameter %c %s removed"</span>,mode,parameter);
674 00172 <a class="code" href="channels_8cpp.html#a38">custom_mode_params</a>.erase(i);
675 00173 <span class="keywordflow">return</span>;
679 00177 log(DEBUG,<span class="stringliteral">"*** BUG *** Attempt to remove non-existent mode parameter!"</span>);
685 <hr><h2>Member Data Documentation</h2>
686 <a name="o16" doxytag="chanrec::bans"></a><p>
687 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
690 <table cellpadding="0" cellspacing="0" border="0">
692 <td class="md" nowrap valign="top"> <a class="el" href="channels_8h.html#a5">BanList</a> <a class="el" href="classchanrec.html#o16">chanrec::bans</a>
697 <table cellspacing=5 cellpadding=0 border=0>
705 The list of all bans set on the channel.
709 Definition at line <a class="el" href="channels_8h-source.html#l00168">168</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>. </td>
712 <a name="o15" doxytag="chanrec::c_private"></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"> short int <a class="el" href="classchanrec.html#o15">chanrec::c_private</a>
723 <table cellspacing=5 cellpadding=0 border=0>
731 Nonzero if the mode +p is set.
733 This value cannot be set at the same time as <a class="el" href="classchanrec.html#o14">chanrec::secret</a>
735 Definition at line <a class="el" href="channels_8h-source.html#l00164">164</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#l00113">chanrec()</a>. </td>
740 <a name="o5" doxytag="chanrec::created"></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"> time_t <a class="el" href="classchanrec.html#o5">chanrec::created</a>
751 <table cellspacing=5 cellpadding=0 border=0>
763 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>.
765 Referenced by <a class="el" href="channels_8cpp-source.html#l00113">chanrec()</a>. </td>
768 <a name="o1" doxytag="chanrec::custom_modes"></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#o1">chanrec::custom_modes</a>[MAXMODES]
779 <table cellspacing=5 cellpadding=0 border=0>
787 Custom modes for the channel.
789 Plugins may use this field in any way they see fit.
791 Definition at line <a class="el" href="channels_8h-source.html#l00103">103</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#l00113">chanrec()</a>, and <a class="el" href="channels_8cpp-source.html#l00125">SetCustomMode()</a>. </td>
796 <a name="o3" doxytag="chanrec::internal_userlist"></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"> std::vector<char*> <a class="el" href="classchanrec.html#o3">chanrec::internal_userlist</a>
807 <table cellspacing=5 cellpadding=0 border=0>
815 User list (casted to char*'s to stop forward declaration stuff) (chicken and egg scenario!).
819 Definition at line <a class="el" href="channels_8h-source.html#l00112">112</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#l00220">AddUser()</a>, <a class="el" href="channels_8cpp-source.html#l00113">chanrec()</a>, <a class="el" href="channels_8cpp-source.html#l00226">DelUser()</a>, and <a class="el" href="channels_8cpp-source.html#l00240">GetUsers()</a>. </td>
824 <a name="o12" doxytag="chanrec::inviteonly"></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"> short int <a class="el" href="classchanrec.html#o12">chanrec::inviteonly</a>
835 <table cellspacing=5 cellpadding=0 border=0>
843 Nonzero if the mode +i is set.
847 Definition at line <a class="el" href="channels_8h-source.html#l00150">150</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#l00113">chanrec()</a>. </td>
852 <a name="o9" doxytag="chanrec::key"></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#o9">chanrec::key</a>[32]
863 <table cellspacing=5 cellpadding=0 border=0>
871 Contains the channel key.
873 If this value is an empty string, there is no channel key in place.
875 Definition at line <a class="el" href="channels_8h-source.html#l00138">138</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#l00113">chanrec()</a>. </td>
880 <a name="o8" doxytag="chanrec::limit"></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"> long <a class="el" href="classchanrec.html#o8">chanrec::limit</a>
891 <table cellspacing=5 cellpadding=0 border=0>
899 Contains the channel user limit.
901 If this value is zero, there is no limit in place.
903 Definition at line <a class="el" href="channels_8h-source.html#l00133">133</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#l00113">chanrec()</a>. </td>
908 <a name="o13" doxytag="chanrec::moderated"></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"> short int <a class="el" href="classchanrec.html#o13">chanrec::moderated</a>
919 <table cellspacing=5 cellpadding=0 border=0>
927 Nonzero if the mode +m is set.
931 Definition at line <a class="el" href="channels_8h-source.html#l00154">154</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#l00113">chanrec()</a>. </td>
936 <a name="o0" doxytag="chanrec::name"></a><p>
937 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
940 <table cellpadding="0" cellspacing="0" border="0">
942 <td class="md" nowrap valign="top"> char <a class="el" href="classchanrec.html#o0">chanrec::name</a>[CHANMAX]
947 <table cellspacing=5 cellpadding=0 border=0>
959 Definition at line <a class="el" href="channels_8h-source.html#l00099">99</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.
961 Referenced by <a class="el" href="channels_8cpp-source.html#l00113">chanrec()</a>, <a class="el" href="channels_8cpp-source.html#l00208">DecUserCounter()</a>, <a class="el" href="channels_8cpp-source.html#l00226">DelUser()</a>, <a class="el" href="channels_8cpp-source.html#l00202">IncUserCounter()</a>, and <a class="el" href="modules_8cpp-source.html#l00665">Server::PseudoToUser()</a>. </td>
964 <a name="o11" doxytag="chanrec::noexternal"></a><p>
965 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
968 <table cellpadding="0" cellspacing="0" border="0">
970 <td class="md" nowrap valign="top"> short int <a class="el" href="classchanrec.html#o11">chanrec::noexternal</a>
975 <table cellspacing=5 cellpadding=0 border=0>
983 Nonzero if the mode +n is set.
987 Definition at line <a class="el" href="channels_8h-source.html#l00146">146</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.
989 Referenced by <a class="el" href="channels_8cpp-source.html#l00113">chanrec()</a>. </td>
992 <a name="o14" doxytag="chanrec::secret"></a><p>
993 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
996 <table cellpadding="0" cellspacing="0" border="0">
998 <td class="md" nowrap valign="top"> short int <a class="el" href="classchanrec.html#o14">chanrec::secret</a>
1003 <table cellspacing=5 cellpadding=0 border=0>
1011 Nonzero if the mode +s is set.
1013 This value cannot be set at the same time as <a class="el" href="classchanrec.html#o15">chanrec::c_private</a>
1015 Definition at line <a class="el" href="channels_8h-source.html#l00159">159</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.
1017 Referenced by <a class="el" href="channels_8cpp-source.html#l00113">chanrec()</a>. </td>
1020 <a name="o7" doxytag="chanrec::setby"></a><p>
1021 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1024 <table cellpadding="0" cellspacing="0" border="0">
1026 <td class="md" nowrap valign="top"> char <a class="el" href="classchanrec.html#o7">chanrec::setby</a>[NICKMAX]
1031 <table cellspacing=5 cellpadding=0 border=0>
1039 The last user to set the topic.
1041 If this member is an empty string, no topic was ever set.
1043 Definition at line <a class="el" href="channels_8h-source.html#l00128">128</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.
1045 Referenced by <a class="el" href="channels_8cpp-source.html#l00113">chanrec()</a>, and <a class="el" href="modules_8cpp-source.html#l00665">Server::PseudoToUser()</a>. </td>
1048 <a name="o4" doxytag="chanrec::topic"></a><p>
1049 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1052 <table cellpadding="0" cellspacing="0" border="0">
1054 <td class="md" nowrap valign="top"> char <a class="el" href="classchanrec.html#o4">chanrec::topic</a>[MAXBUF]
1059 <table cellspacing=5 cellpadding=0 border=0>
1069 If this is an empty string, no channel topic is set.
1071 Definition at line <a class="el" href="channels_8h-source.html#l00117">117</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.
1073 Referenced by <a class="el" href="channels_8cpp-source.html#l00113">chanrec()</a>, and <a class="el" href="modules_8cpp-source.html#l00665">Server::PseudoToUser()</a>. </td>
1076 <a name="o10" doxytag="chanrec::topiclock"></a><p>
1077 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1080 <table cellpadding="0" cellspacing="0" border="0">
1082 <td class="md" nowrap valign="top"> short int <a class="el" href="classchanrec.html#o10">chanrec::topiclock</a>
1087 <table cellspacing=5 cellpadding=0 border=0>
1095 Nonzero if the mode +t is set.
1099 Definition at line <a class="el" href="channels_8h-source.html#l00142">142</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.
1101 Referenced by <a class="el" href="channels_8cpp-source.html#l00113">chanrec()</a>. </td>
1104 <a name="o6" doxytag="chanrec::topicset"></a><p>
1105 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1108 <table cellpadding="0" cellspacing="0" border="0">
1110 <td class="md" nowrap valign="top"> time_t <a class="el" href="classchanrec.html#o6">chanrec::topicset</a>
1115 <table cellspacing=5 cellpadding=0 border=0>
1125 If no topic was ever set, this will be equal to <a class="el" href="classchanrec.html#o5">chanrec::created</a>
1127 Definition at line <a class="el" href="channels_8h-source.html#l00124">124</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.
1129 Referenced by <a class="el" href="channels_8cpp-source.html#l00113">chanrec()</a>, and <a class="el" href="modules_8cpp-source.html#l00665">Server::PseudoToUser()</a>. </td>
1132 <a name="o2" doxytag="chanrec::users"></a><p>
1133 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1136 <table cellpadding="0" cellspacing="0" border="0">
1138 <td class="md" nowrap valign="top"> long <a class="el" href="classchanrec.html#o2">chanrec::users</a>
1143 <table cellspacing=5 cellpadding=0 border=0>
1151 Count of users on the channel used for fast user counting.
1155 Definition at line <a class="el" href="channels_8h-source.html#l00107">107</a> of file <a class="el" href="channels_8h-source.html">channels.h</a>.
1157 Referenced by <a class="el" href="channels_8cpp-source.html#l00113">chanrec()</a>, <a class="el" href="channels_8cpp-source.html#l00208">DecUserCounter()</a>, <a class="el" href="channels_8cpp-source.html#l00215">GetUserCounter()</a>, and <a class="el" href="channels_8cpp-source.html#l00202">IncUserCounter()</a>. </td>
1160 <hr>The documentation for this class was generated from the following files:<ul>
1161 <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>
1162 <hr size="1"><address style="align: right;"><small>Generated on Tue Apr 26 17:11:47 2005 for InspIRCd by
1163 <a href="http://www.doxygen.org/index.html">
1164 <img src="doxygen.png" alt="doxygen" align="middle" border=0 >
1165 </a>1.3.3 </small></address>