X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=docs%2Fmodule-doc%2Fchannels_8cpp-source.html;h=c149c9b12159e93dc7be30eb83476959c29505c5;hb=5a2675d174e661c55843b3795afe2d688e7197f9;hp=ddf1b9260c728f790f020125031e0940e7eb52f4;hpb=3f4b15c2cfe51a654b5167273f5a95b29e757cf1;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/docs/module-doc/channels_8cpp-source.html b/docs/module-doc/channels_8cpp-source.html index ddf1b9260..c149c9b12 100644 --- a/docs/module-doc/channels_8cpp-source.html +++ b/docs/module-doc/channels_8cpp-source.html @@ -117,94 +117,138 @@ 00110 00111 std::vector<ModeParameter> custom_mode_params; 00112 -00113 chanrec::chanrec() +00113 chanrec::chanrec() 00114 { 00115 strcpy(name,""); 00116 strcpy(custom_modes,""); -00117 strcpy(topic,""); -00118 strcpy(setby,""); -00119 strcpy(key,""); -00120 created = topicset = limit = 0; -00121 topiclock = noexternal = inviteonly = moderated = secret = c_private = false; -00122 } -00123 -00124 void chanrec::SetCustomMode(char mode,bool mode_on) -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 } -00147 +00117 strcpy(topic,""); +00118 strcpy(setby,""); +00119 strcpy(key,""); +00120 created = topicset = limit = users = 0; +00121 topiclock = noexternal = inviteonly = moderated = secret = c_private = false; +00122 internal_userlist.clear(); +00123 } +00124 +00125 void chanrec::SetCustomMode(char mode,bool mode_on) +00126 { +00127 if (mode_on) { +00128 char m[3]; +00129 m[0] = mode; +00130 m[1] = '\0'; +00131 if (!strchr(this->custom_modes,mode)) +00132 { +00133 strlcat(custom_modes,m,MAXMODES); +00134 } +00135 log(DEBUG,"Custom mode %c set",mode); +00136 } +00137 else { +00138 +00139 std::string a = this->custom_modes; +00140 int pos = a.find(mode); +00141 a.erase(pos,1); +00142 strncpy(this->custom_modes,a.c_str(),MAXMODES); +00143 +00144 log(DEBUG,"Custom mode %c removed: modelist='%s'",mode,this->custom_modes); +00145 this->SetCustomModeParam(mode,"",false); +00146 } +00147 } 00148 -00149 void chanrec::SetCustomModeParam(char mode,char* parameter,bool mode_on) -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 } -00179 -00180 bool chanrec::IsCustomModeSet(char mode) -00181 { -00182 log(DEBUG,"Checking ISCustomModeSet: %c %s",mode,this->custom_modes); -00183 return (strchr(this->custom_modes,mode) != 0); -00184 } -00185 -00186 std::string chanrec::GetModeParameter(char mode) -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 } -
Generated on Thu Apr 14 21:12:04 2005 for InspIRCd by +00149 +00150 void chanrec::SetCustomModeParam(char mode,char* parameter,bool mode_on) +00151 { +00152 +00153 log(DEBUG,"SetCustomModeParam called"); +00154 ModeParameter M; +00155 M.mode = mode; +00156 strlcpy(M.channel,this->name,CHANMAX); +00157 strlcpy(M.parameter,parameter,MAXBUF); +00158 if (mode_on) +00159 { +00160 log(DEBUG,"Custom mode parameter %c %s added",mode,parameter); +00161 custom_mode_params.push_back(M); +00162 } +00163 else +00164 { +00165 if (custom_mode_params.size()) +00166 { +00167 for (vector<ModeParameter>::iterator i = custom_mode_params.begin(); i < custom_mode_params.end(); i++) +00168 { +00169 if ((i->mode == mode) && (!strcasecmp(this->name,i->channel))) +00170 { +00171 log(DEBUG,"Custom mode parameter %c %s removed",mode,parameter); +00172 custom_mode_params.erase(i); +00173 return; +00174 } +00175 } +00176 } +00177 log(DEBUG,"*** BUG *** Attempt to remove non-existent mode parameter!"); +00178 } +00179 } +00180 +00181 bool chanrec::IsCustomModeSet(char mode) +00182 { +00183 log(DEBUG,"Checking ISCustomModeSet: %c %s",mode,this->custom_modes); +00184 return (strchr(this->custom_modes,mode) != 0); +00185 } +00186 +00187 std::string chanrec::GetModeParameter(char mode) +00188 { +00189 if (custom_mode_params.size()) +00190 { +00191 for (vector<ModeParameter>::iterator i = custom_mode_params.begin(); i < custom_mode_params.end(); i++) +00192 { +00193 if ((i->mode == mode) && (!strcasecmp(this->name,i->channel))) +00194 { +00195 return std::string(i->parameter); +00196 } +00197 } +00198 } +00199 return std::string(""); +00200 } +00201 +00202 void chanrec::IncUserCounter() +00203 { +00204 this->users++; +00205 log(DEBUG,"Incremented channel user count for %s to %lu",name,(unsigned long)users); +00206 } +00207 +00208 void chanrec::DecUserCounter() +00209 { +00210 if (this->users > 0) +00211 this->users--; +00212 log(DEBUG,"Decremented channel user count for %s to %lu",name,(unsigned long)users); +00213 } +00214 +00215 long chanrec::GetUserCounter() +00216 { +00217 return (this->users); +00218 } +00219 +00220 void chanrec::AddUser(char* castuser) +00221 { +00222 internal_userlist.push_back(castuser); +00223 log(DEBUG,"Added casted user to channel's internal list"); +00224 } +00225 +00226 void chanrec::DelUser(char* castuser) +00227 { +00228 for (std::vector<char*>::iterator a = internal_userlist.begin(); a < internal_userlist.end(); a++) +00229 { +00230 if (*a == castuser) +00231 { +00232 log(DEBUG,"Removed casted user from channel's internal list"); +00233 internal_userlist.erase(a); +00234 return; +00235 } +00236 } +00237 log(DEBUG,"BUG BUG BUG! Attempt to remove an uncasted user from the internal list of %s!",name); +00238 } +00239 +00240 std::vector<char*> *chanrec::GetUsers() +00241 { +00242 return &internal_userlist; +00243 } +
Generated on Tue Apr 26 17:11:43 2005 for InspIRCd by doxygen 1.3.3