X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=docs%2Fmodule-doc%2Fchannels_8cpp-source.html;h=c149c9b12159e93dc7be30eb83476959c29505c5;hb=5a2675d174e661c55843b3795afe2d688e7197f9;hp=d95edbda6f2a43800e4cb6e014887b95e0261bff;hpb=755d67224f033aaa9b4ef3d2dd00f46bb8c19dc2;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 d95edbda6..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 } -