X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=docs%2Fmodule-doc%2Fchannels_8cpp-source.html;h=c149c9b12159e93dc7be30eb83476959c29505c5;hb=5a2675d174e661c55843b3795afe2d688e7197f9;hp=cf89697dc1965277210f3160eac9192d6dbcbc53;hpb=9c8b44176b47d2186c88743dc1f68023c26d780b;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 cf89697dc..c149c9b12 100644 --- a/docs/module-doc/channels_8cpp-source.html +++ b/docs/module-doc/channels_8cpp-source.html @@ -111,99 +111,144 @@ 00104 00105 extern FILE *log_file; 00106 -00107 -00108 using namespace std; -00109 -00110 std::vector<ModeParameter> custom_mode_params; -00111 -00112 chanrec::chanrec() -00113 { -00114 strcpy(name,""); -00115 strcpy(custom_modes,""); -00116 strcpy(topic,""); -00117 strcpy(setby,""); -00118 strcpy(key,""); -00119 created = topicset = limit = 0; -00120 topiclock = noexternal = inviteonly = moderated = secret = c_private = false; -00121 } -00122 -00123 void chanrec::SetCustomMode(char mode,bool mode_on) -00124 { -00125 if (mode_on) { -00126 char m[3]; -00127 m[0] = mode; -00128 m[1] = '\0'; -00129 if (!strchr(this->custom_modes,mode)) -00130 { -00131 strlcat(custom_modes,m,MAXMODES); -00132 } -00133 log(DEBUG,"Custom mode %c set",mode); -00134 } -00135 else { -00136 -00137 std::string a = this->custom_modes; -00138 int pos = a.find(mode); -00139 a.erase(pos,1); -00140 strncpy(this->custom_modes,a.c_str(),MAXMODES); -00141 -00142 log(DEBUG,"Custom mode %c removed: modelist='%s'",mode,this->custom_modes); -00143 this->SetCustomModeParam(mode,"",false); -00144 } -00145 } -00146 -00147 -00148 void chanrec::SetCustomModeParam(char mode,char* parameter,bool mode_on) -00149 { -00150 -00151 log(DEBUG,"SetCustomModeParam called"); -00152 ModeParameter M; -00153 M.mode = mode; -00154 strlcpy(M.channel,this->name,CHANMAX); -00155 strlcpy(M.parameter,parameter,MAXBUF); -00156 if (mode_on) -00157 { -00158 log(DEBUG,"Custom mode parameter %c %s added",mode,parameter); -00159 custom_mode_params.push_back(M); -00160 } -00161 else -00162 { -00163 if (custom_mode_params.size()) -00164 { -00165 for (vector<ModeParameter>::iterator i = custom_mode_params.begin(); i < custom_mode_params.end(); i++) -00166 { -00167 if ((i->mode == mode) && (!strcasecmp(this->name,i->channel))) -00168 { -00169 log(DEBUG,"Custom mode parameter %c %s removed",mode,parameter); -00170 custom_mode_params.erase(i); -00171 return; -00172 } -00173 } -00174 } -00175 log(DEBUG,"*** BUG *** Attempt to remove non-existent mode parameter!"); -00176 } -00177 } -00178 -00179 bool chanrec::IsCustomModeSet(char mode) -00180 { -00181 log(DEBUG,"Checking ISCustomModeSet: %c %s",mode,this->custom_modes); -00182 return (strchr(this->custom_modes,mode) != 0); -00183 } -00184 -00185 std::string chanrec::GetModeParameter(char mode) -00186 { -00187 if (custom_mode_params.size()) -00188 { -00189 for (vector<ModeParameter>::iterator i = custom_mode_params.begin(); i < custom_mode_params.end(); i++) -00190 { -00191 if ((i->mode == mode) && (!strcasecmp(this->name,i->channel))) -00192 { -00193 return std::string(i->parameter); -00194 } -00195 } -00196 } -00197 return std::string(""); -00198 } -
Generated on Mon Apr 4 18:12:47 2005 for InspIRCd by +00107 extern time_t TIME; +00108 +00109 using namespace std; +00110 +00111 std::vector<ModeParameter> custom_mode_params; +00112 +00113 chanrec::chanrec() +00114 { +00115 strcpy(name,""); +00116 strcpy(custom_modes,""); +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 +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