-
+ |
chanrec::chanrec |
( |
- |
- ) |
+ |
+ ) |
|
@@ -100,36 +112,36 @@ Definition at line 83 of
-Creates a channel record and initialises it with default values.
+Creates a channel record and initialises it with default values.
-Definition at line 96 of file channels.cpp.
+Definition at line 113 of file channels.cpp.
-References c_private, created, inviteonly, limit, moderated, noexternal, secret, topiclock, and topicset.
+References c_private, created, custom_modes, inviteonly, key, limit, moderated, name, noexternal, secret, setby, topic, topiclock, and topicset.
- |
-
+
-
+ |
Member Function Documentation
-
+
-
+ |
std::string chanrec::GetModeParameter |
( |
char |
- mode |
- ) |
+ mode |
+ ) |
|
@@ -180,41 +192,41 @@ Definition at line 174 o
-Returns the parameter for a custom mode on a channel.
+Returns the parameter for a custom mode on a channel.
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.
-Definition at line 172 of file channels.cpp.
-
-References custom_mode_params.
-
- 00173 {
-00174 if (custom_mode_params.size())
-00175 {
-00176 for (vector<ModeParameter>::iterator i = custom_mode_params.begin(); i < custom_mode_params.end(); i++)
-00177 {
-00178 if ((i->mode == mode) && (!strcasecmp(this->name,i->channel)))
-00179 {
-00180 return std::string(i->parameter);
-00181 }
-00182 }
-00183 }
-00184 return std::string("");
-00185 }
+Definition at line 186 of file channels.cpp.
+
+References custom_mode_params.
+
+ 00187 {
+00188 if (custom_mode_params.size())
+00189 {
+00190 for (vector<ModeParameter>::iterator i = custom_mode_params.begin(); i < custom_mode_params.end(); i++)
+00191 {
+00192 if ((i->mode == mode) && (!strcasecmp(this->name,i->channel)))
+00193 {
+00194 return std::string(i->parameter);
+00195 }
+00196 }
+00197 }
+00198 return std::string("");
+00199 }
|
-
+
-
+ |
bool chanrec::IsCustomModeSet |
( |
char |
- mode |
- ) |
+ mode |
+ ) |
|
@@ -230,35 +242,37 @@ References custom_mode_par
-Returns true if a custom mode is set on a channel.
+Returns true if a custom mode is set on a channel.
-Definition at line 166 of file channels.cpp.
+Definition at line 180 of file channels.cpp.
- 00167 {
-00168 log(DEBUG,"Checking ISCustomModeSet: %c %s",mode,this->custom_modes);
-00169 return (strchr(this->custom_modes,mode) != 0);
-00170 }
+References DEBUG.
+
+ 00181 {
+00182 log(DEBUG,"Checking ISCustomModeSet: %c %s",mode,this->custom_modes);
+00183 return (strchr(this->custom_modes,mode) != 0);
+00184 }
|
-
+
-
+ |
void chanrec::SetCustomMode |
( |
char |
- mode, |
+ mode, |
|
|
bool |
- mode_on |
+ mode_on |
|
@@ -278,64 +292,61 @@ Definition at line 166
-Sets or unsets a custom mode in the channels info.
+Sets or unsets a custom mode in the channels info.
-Definition at line 107 of file channels.cpp.
+Definition at line 124 of file channels.cpp.
-References custom_modes, and SetCustomModeParam().
+References custom_modes, DEBUG, and SetCustomModeParam().
- 00108 {
-00109 if (mode_on) {
-00110 char m[3];
-00111 m[0] = mode;
-00112 m[1] = '\0';
-00113 if (!strchr(this->custom_modes,mode))
-00114 {
-00115 strncat(custom_modes,m,MAXMODES);
-00116 }
-00117 log(DEBUG,"Custom mode %c set",mode);
-00118 }
-00119 else {
-00120 char temp[MAXBUF];
-00121 int count = 0;
-00122 for (int q = 0; q < strlen(custom_modes); q++) {
-00123 if (custom_modes[q] != mode) {
-00124 temp[count++] = mode;
-00125 }
-00126 }
-00127 temp[count] = '\0';
-00128 strncpy(custom_modes,temp,MAXMODES);
-00129 log(DEBUG,"Custom mode %c removed",mode);
-00130 this->SetCustomModeParam(mode,"",false);
-00131 }
-00132 }
+00125 {
+00126 if (mode_on) {
+00127 char m[3];
+00128 m[0] = mode;
+00129 m[1] = '\0';
+00130 if (!strchr(this->custom_modes,mode))
+00131 {
+00132 strlcat(custom_modes,m,MAXMODES);
+00133 }
+00134 log(DEBUG,"Custom mode %c set",mode);
+00135 }
+00136 else {
+00137
+00138 std::string a = this->custom_modes;
+00139 int pos = a.find(mode);
+00140 a.erase(pos,1);
+00141 strncpy(this->custom_modes,a.c_str(),MAXMODES);
+00142
+00143 log(DEBUG,"Custom mode %c removed: modelist='%s'",mode,this->custom_modes);
+00144 this->SetCustomModeParam(mode,"",false);
+00145 }
+00146 }
|
-
+
-
+ |
void chanrec::SetCustomModeParam |
( |
char |
- mode, |
+ mode, |
|
|
char * |
- parameter, |
+ parameter, |
|
|
bool |
- mode_on |
+ mode_on |
|
@@ -355,56 +366,56 @@ References custom_modes,
-Sets or unsets the parameters for a custom mode in a channels info.
+Sets or unsets the parameters for a custom mode in a channels info.
-Definition at line 135 of file channels.cpp.
+Definition at line 149 of file channels.cpp.
-References ModeParameter::channel, custom_mode_params, ModeParameter::mode, and ModeParameter::parameter.
+References ModeParameter::channel, custom_mode_params, DEBUG, ModeParameter::mode, and ModeParameter::parameter.
-Referenced by SetCustomMode().
+Referenced by SetCustomMode().
- 00136 {
-00137
-00138 log(DEBUG,"SetCustomModeParam called");
-00139 ModeParameter M;
-00140 M.mode = mode;
-00141 strcpy(M.channel,this->name);
-00142 strcpy(M.parameter,parameter);
-00143 if (mode_on)
-00144 {
-00145 log(DEBUG,"Custom mode parameter %c %s added",mode,parameter);
-00146 custom_mode_params.push_back(M);
-00147 }
-00148 else
-00149 {
-00150 if (custom_mode_params.size())
-00151 {
-00152 for (vector<ModeParameter>::iterator i = custom_mode_params.begin(); i < custom_mode_params.end(); i++)
-00153 {
-00154 if ((i->mode == mode) && (!strcasecmp(this->name,i->channel)))
-00155 {
-00156 log(DEBUG,"Custom mode parameter %c %s removed",mode,parameter);
-00157 custom_mode_params.erase(i);
-00158 return;
-00159 }
-00160 }
-00161 }
-00162 log(DEBUG,"*** BUG *** Attempt to remove non-existent mode parameter!");
-00163 }
-00164 }
+00150 {
+00151
+00152 log(DEBUG,"SetCustomModeParam called");
+00153 ModeParameter M;
+00154 M.mode = mode;
+00155 strlcpy(M.channel,this->name,CHANMAX);
+00156 strlcpy(M.parameter,parameter,MAXBUF);
+00157 if (mode_on)
+00158 {
+00159 log(DEBUG,"Custom mode parameter %c %s added",mode,parameter);
+00160 custom_mode_params.push_back(M);
+00161 }
+00162 else
+00163 {
+00164 if (custom_mode_params.size())
+00165 {
+00166 for (vector<ModeParameter>::iterator i = custom_mode_params.begin(); i < custom_mode_params.end(); i++)
+00167 {
+00168 if ((i->mode == mode) && (!strcasecmp(this->name,i->channel)))
+00169 {
+00170 log(DEBUG,"Custom mode parameter %c %s removed",mode,parameter);
+00171 custom_mode_params.erase(i);
+00172 return;
+00173 }
+00174 }
+00175 }
+00176 log(DEBUG,"*** BUG *** Attempt to remove non-existent mode parameter!");
+00177 }
+00178 }
|
Member Data Documentation
-
-
+
+
-
+ |
|
@@ -417,20 +428,20 @@ Referenced by SetCustomMod
-The list of all bans set on the channel.
+The list of all bans set on the channel.
-Definition at line 148 of file channels.h. |
+Definition at line 159 of file channels.h.
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+ |
|
@@ -555,20 +566,22 @@ Referenced by chanrec()
-Contains the channel key.
+Contains the channel key.
If this value is an empty string, there is no channel key in place.
-Definition at line 118 of file channels.h.
+Definition at line 129 of file channels.h.
+
+Referenced by chanrec().
-
-
+
+
-
+ |
|
@@ -581,22 +594,22 @@ Definition at line 118 o
-Contains the channel user limit.
+Contains the channel user limit.
If this value is zero, there is no limit in place.
-Definition at line 113 of file channels.h.
+Definition at line 124 of file channels.h.
-Referenced by chanrec(). |
+Referenced by chanrec().
-
-
+
+
-
-
+
+
-
-
+
+
-
+ |
|
@@ -663,22 +678,22 @@ Definition at line 88 of
-Nonzero if the mode +n is set.
+Nonzero if the mode +n is set.
-Definition at line 126 of file channels.h.
+Definition at line 137 of file channels.h.
-Referenced by chanrec(). |
+Referenced by chanrec().
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+ |
|
@@ -771,22 +790,22 @@ Definition at line 97 of
-Nonzero if the mode +t is set.
+Nonzero if the mode +t is set.
-Definition at line 122 of file channels.h.
+Definition at line 133 of file channels.h.
-Referenced by chanrec(). |
+Referenced by chanrec().
-
-
+
+
The documentation for this class was generated from the following files:
- Generated on Sat May 1 20:58:00 2004 for InspIRCd by
+ Generated on Wed Apr 13 13:07:01 2005 for InspIRCd by
- 1.3-rc3
+
+1.3.3
| | | | | |