X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=docs%2Fmodule-doc%2Fchannels_8cpp-source.html;h=960e756a1479af457cd23fad7c777a01facc5f5e;hb=3d7312f8af1becdbe458392e14ea64c904ee7b92;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..960e756a1 100644 --- a/docs/module-doc/channels_8cpp-source.html +++ b/docs/module-doc/channels_8cpp-source.html @@ -111,99 +111,100 @@ 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 +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 = 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 -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 +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 Sat Apr 9 14:38:24 2005 for InspIRCd by doxygen 1.3.3