diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-11 16:14:44 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-11 16:14:44 +0000 |
commit | cfb2c2fff47d99f43434de7db339c2f2237c6bad (patch) | |
tree | badd13cd7ee9a45dbbc683d64e44a01e0677ce58 /src | |
parent | 7775a195d9c417e52eaaf912ec51d62bf0fd9a54 (diff) |
CamelCaseRocksSoMuchICamelCasedAllTheMethodsOfClassInspIRCdSoThatItAllLooksNeat.
NowSomebodyHasToSpendHoursDocumentingAllOfThisIWonderWhoThatWillEndUpBeing...
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4889 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
54 files changed, 157 insertions, 157 deletions
diff --git a/src/channels.cpp b/src/channels.cpp index 8011a1ff4..fff276970 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -558,14 +558,14 @@ long chanrec::KickUser(userrec *src, userrec *user, const char* reason) src->WriteServ("441 %s %s %s :They are not on that channel",src->nick, user->nick, this->name); return this->GetUserCounter(); } - if ((ServerInstance->is_uline(user->server)) && (!ServerInstance->is_uline(src->server))) + if ((ServerInstance->ULine(user->server)) && (!ServerInstance->ULine(src->server))) { src->WriteServ("482 %s %s :Only a u-line may kick a u-line from a channel.",src->nick, this->name); return this->GetUserCounter(); } int MOD_RESULT = 0; - if (!ServerInstance->is_uline(src->server)) + if (!ServerInstance->ULine(src->server)) { MOD_RESULT = 0; FOREACH_RESULT(I_OnUserPreKick,OnUserPreKick(src,user,this,reason)); @@ -576,10 +576,10 @@ long chanrec::KickUser(userrec *src, userrec *user, const char* reason) if (MOD_RESULT != -1) { FOREACH_RESULT(I_OnAccessCheck,OnAccessCheck(src,user,this,AC_KICK)); - if ((MOD_RESULT == ACR_DENY) && (!ServerInstance->is_uline(src->server))) + if ((MOD_RESULT == ACR_DENY) && (!ServerInstance->ULine(src->server))) return this->GetUserCounter(); - if ((MOD_RESULT == ACR_DEFAULT) || (!ServerInstance->is_uline(src->server))) + if ((MOD_RESULT == ACR_DEFAULT) || (!ServerInstance->ULine(src->server))) { int them = this->GetStatus(src); int us = this->GetStatus(user); @@ -919,7 +919,7 @@ int chanrec::GetStatusFlags(userrec *user) int chanrec::GetStatus(userrec *user) { - if (ServerInstance->is_uline(user->server)) + if (ServerInstance->ULine(user->server)) return STATUS_OP; for (std::vector<ucrec*>::const_iterator i = user->chans.begin(); i != user->chans.end(); i++) diff --git a/src/cmd_eline.cpp b/src/cmd_eline.cpp index e25fb37e3..9e9274de7 100644 --- a/src/cmd_eline.cpp +++ b/src/cmd_eline.cpp @@ -30,19 +30,19 @@ void cmd_eline::Handle (const char** parameters, int pcnt, userrec *user) { if (pcnt >= 3) { - if (ServerInstance->host_matches_everyone(parameters[0],user)) + if (ServerInstance->HostMatchesEveryone(parameters[0],user)) return; - ServerInstance->XLines->add_eline(ServerInstance->duration(parameters[1]),user->nick,parameters[2],parameters[0]); - FOREACH_MOD(I_OnAddELine,OnAddELine(ServerInstance->duration(parameters[1]), user, parameters[2], parameters[0])); + ServerInstance->XLines->add_eline(ServerInstance->Duration(parameters[1]),user->nick,parameters[2],parameters[0]); + FOREACH_MOD(I_OnAddELine,OnAddELine(ServerInstance->Duration(parameters[1]), user, parameters[2], parameters[0])); - if (!ServerInstance->duration(parameters[1])) + if (!ServerInstance->Duration(parameters[1])) { ServerInstance->WriteOpers("*** %s added permanent E-line for %s.",user->nick,parameters[0]); } else { - ServerInstance->WriteOpers("*** %s added timed E-line for %s, expires in %d seconds.",user->nick,parameters[0],ServerInstance->duration(parameters[1])); + ServerInstance->WriteOpers("*** %s added timed E-line for %s, expires in %d seconds.",user->nick,parameters[0],ServerInstance->Duration(parameters[1])); } } else diff --git a/src/cmd_gline.cpp b/src/cmd_gline.cpp index 69d8b51ca..03725a898 100644 --- a/src/cmd_gline.cpp +++ b/src/cmd_gline.cpp @@ -30,19 +30,19 @@ void cmd_gline::Handle (const char** parameters, int pcnt, userrec *user) { if (pcnt >= 3) { - if (ServerInstance->host_matches_everyone(parameters[0],user)) + if (ServerInstance->HostMatchesEveryone(parameters[0],user)) return; - ServerInstance->XLines->add_gline(ServerInstance->duration(parameters[1]),user->nick,parameters[2],parameters[0]); - FOREACH_MOD(I_OnAddGLine,OnAddGLine(ServerInstance->duration(parameters[1]), user, parameters[2], parameters[0])); + ServerInstance->XLines->add_gline(ServerInstance->Duration(parameters[1]),user->nick,parameters[2],parameters[0]); + FOREACH_MOD(I_OnAddGLine,OnAddGLine(ServerInstance->Duration(parameters[1]), user, parameters[2], parameters[0])); - if (!ServerInstance->duration(parameters[1])) + if (!ServerInstance->Duration(parameters[1])) { ServerInstance->WriteOpers("*** %s added permanent G-line for %s.",user->nick,parameters[0]); } else { - ServerInstance->WriteOpers("*** %s added timed G-line for %s, expires in %d seconds.",user->nick,parameters[0],ServerInstance->duration(parameters[1])); + ServerInstance->WriteOpers("*** %s added timed G-line for %s, expires in %d seconds.",user->nick,parameters[0],ServerInstance->Duration(parameters[1])); } ServerInstance->XLines->apply_lines(APPLY_GLINES); diff --git a/src/cmd_kick.cpp b/src/cmd_kick.cpp index 6a37052db..9838995d2 100644 --- a/src/cmd_kick.cpp +++ b/src/cmd_kick.cpp @@ -35,7 +35,7 @@ void cmd_kick::Handle (const char** parameters, int pcnt, userrec *user) return; } - if ((IS_LOCAL(user)) && (!c->HasUser(user)) && (!ServerInstance->is_uline(user->server))) + if ((IS_LOCAL(user)) && (!c->HasUser(user)) && (!ServerInstance->ULine(user->server))) { user->WriteServ( "442 %s %s :You're not on that channel!", user->nick, parameters[0]); return; diff --git a/src/cmd_kline.cpp b/src/cmd_kline.cpp index 7e9555956..4baeefb8f 100644 --- a/src/cmd_kline.cpp +++ b/src/cmd_kline.cpp @@ -35,19 +35,19 @@ void cmd_kline::Handle (const char** parameters, int pcnt, userrec *user) { if (pcnt >= 3) { - if (ServerInstance->host_matches_everyone(parameters[0],user)) + if (ServerInstance->HostMatchesEveryone(parameters[0],user)) return; - ServerInstance->XLines->add_kline(ServerInstance->duration(parameters[1]),user->nick,parameters[2],parameters[0]); - FOREACH_MOD(I_OnAddKLine,OnAddKLine(ServerInstance->duration(parameters[1]), user, parameters[2], parameters[0])); + ServerInstance->XLines->add_kline(ServerInstance->Duration(parameters[1]),user->nick,parameters[2],parameters[0]); + FOREACH_MOD(I_OnAddKLine,OnAddKLine(ServerInstance->Duration(parameters[1]), user, parameters[2], parameters[0])); - if (!ServerInstance->duration(parameters[1])) + if (!ServerInstance->Duration(parameters[1])) { ServerInstance->WriteOpers("*** %s added permanent K-line for %s.",user->nick,parameters[0]); } else { - ServerInstance->WriteOpers("*** %s added timed K-line for %s, expires in %d seconds.",user->nick,parameters[0],ServerInstance->duration(parameters[1])); + ServerInstance->WriteOpers("*** %s added timed K-line for %s, expires in %d seconds.",user->nick,parameters[0],ServerInstance->Duration(parameters[1])); } ServerInstance->XLines->apply_lines(APPLY_KLINES); diff --git a/src/cmd_lusers.cpp b/src/cmd_lusers.cpp index 8ab9392bc..39f093072 100644 --- a/src/cmd_lusers.cpp +++ b/src/cmd_lusers.cpp @@ -26,14 +26,14 @@ void cmd_lusers::Handle (const char** parameters, int pcnt, userrec *user) { // this lusers command shows one server at all times because // a protocol module must override it to show those stats. - user->WriteServ("251 %s :There are %d users and %d invisible on 1 server",user->nick,ServerInstance->usercnt()-ServerInstance->usercount_invisible(),ServerInstance->usercount_invisible()); - if (ServerInstance->usercount_opers()) - user->WriteServ("252 %s %d :operator(s) online",user->nick,ServerInstance->usercount_opers()); - if (ServerInstance->usercount_unknown()) - user->WriteServ("253 %s %d :unknown connections",user->nick,ServerInstance->usercount_unknown()); - if (ServerInstance->chancount()) - user->WriteServ("254 %s %d :channels formed",user->nick,ServerInstance->chancount()); - if (ServerInstance->local_count()) - user->WriteServ("254 %s :I have %d clients and 0 servers",user->nick,ServerInstance->local_count()); + user->WriteServ("251 %s :There are %d users and %d invisible on 1 server",user->nick,ServerInstance->UserCount()-ServerInstance->InvisibleUserCount(),ServerInstance->InvisibleUserCount()); + if (ServerInstance->OperCount()) + user->WriteServ("252 %s %d :operator(s) online",user->nick,ServerInstance->OperCount()); + if (ServerInstance->UnregisteredUserCount()) + user->WriteServ("253 %s %d :unknown connections",user->nick,ServerInstance->UnregisteredUserCount()); + if (ServerInstance->ChannelCount()) + user->WriteServ("254 %s %d :channels formed",user->nick,ServerInstance->ChannelCount()); + if (ServerInstance->LocalUserCount()) + user->WriteServ("254 %s :I have %d clients and 0 servers",user->nick,ServerInstance->LocalUserCount()); } diff --git a/src/cmd_notice.cpp b/src/cmd_notice.cpp index 257fd7495..53d6e0d9e 100644 --- a/src/cmd_notice.cpp +++ b/src/cmd_notice.cpp @@ -37,7 +37,7 @@ void cmd_notice::Handle (const char** parameters, int pcnt, userrec *user) if (ServerInstance->Parser->LoopCall(user, this, parameters, pcnt, 0)) return; - if ((parameters[0][0] == '$') && ((*user->oper) || (ServerInstance->is_uline(user->server)))) + if ((parameters[0][0] == '$') && ((*user->oper) || (ServerInstance->ULine(user->server)))) { int MOD_RESULT = 0; std::string temp = parameters[1]; diff --git a/src/cmd_oper.cpp b/src/cmd_oper.cpp index 67ce00c19..e8b22d14d 100644 --- a/src/cmd_oper.cpp +++ b/src/cmd_oper.cpp @@ -73,7 +73,7 @@ void cmd_oper::Handle (const char** parameters, int pcnt, userrec *user) ServerInstance->Config->ConfValue(ServerInstance->Config->config_data, "oper", "type", i, OperType, MAXBUF); ServerInstance->Config->ConfValue(ServerInstance->Config->config_data, "oper", "host", i, HostName, MAXBUF); - if ((!strcmp(LoginName,parameters[0])) && (!ServerInstance->operstrcmp(Password,parameters[1])) && (OneOfMatches(TheHost,TheIP,HostName))) + if ((!strcmp(LoginName,parameters[0])) && (!ServerInstance->OperPassCompare(Password,parameters[1])) && (OneOfMatches(TheHost,TheIP,HostName))) { fail2 = true; for (j =0; j < ServerInstance->Config->ConfValueEnum(ServerInstance->Config->config_data, "type"); j++) diff --git a/src/cmd_privmsg.cpp b/src/cmd_privmsg.cpp index 9ee335234..557289bbd 100644 --- a/src/cmd_privmsg.cpp +++ b/src/cmd_privmsg.cpp @@ -35,7 +35,7 @@ void cmd_privmsg::Handle (const char** parameters, int pcnt, userrec *user) if (ServerInstance->Parser->LoopCall(user, this, parameters, pcnt, 0)) return; - if ((parameters[0][0] == '$') && ((*user->oper) || (ServerInstance->is_uline(user->server)))) + if ((parameters[0][0] == '$') && ((*user->oper) || (ServerInstance->ULine(user->server)))) { int MOD_RESULT = 0; std::string temp = parameters[1]; diff --git a/src/cmd_qline.cpp b/src/cmd_qline.cpp index 1e2b7cbd0..5be818ff4 100644 --- a/src/cmd_qline.cpp +++ b/src/cmd_qline.cpp @@ -27,17 +27,17 @@ void cmd_qline::Handle (const char** parameters, int pcnt, userrec *user) { if (pcnt >= 3) { - if (ServerInstance->nick_matches_everyone(parameters[0],user)) + if (ServerInstance->NickMatchesEveryone(parameters[0],user)) return; - ServerInstance->XLines->add_qline(ServerInstance->duration(parameters[1]),user->nick,parameters[2],parameters[0]); - FOREACH_MOD(I_OnAddQLine,OnAddQLine(ServerInstance->duration(parameters[1]), user, parameters[2], parameters[0])); - if (!ServerInstance->duration(parameters[1])) + ServerInstance->XLines->add_qline(ServerInstance->Duration(parameters[1]),user->nick,parameters[2],parameters[0]); + FOREACH_MOD(I_OnAddQLine,OnAddQLine(ServerInstance->Duration(parameters[1]), user, parameters[2], parameters[0])); + if (!ServerInstance->Duration(parameters[1])) { ServerInstance->WriteOpers("*** %s added permanent Q-line for %s.",user->nick,parameters[0]); } else { - ServerInstance->WriteOpers("*** %s added timed Q-line for %s, expires in %d seconds.",user->nick,parameters[0],ServerInstance->duration(parameters[1])); + ServerInstance->WriteOpers("*** %s added timed Q-line for %s, expires in %d seconds.",user->nick,parameters[0],ServerInstance->Duration(parameters[1])); } ServerInstance->XLines->apply_lines(APPLY_QLINES); } diff --git a/src/cmd_zline.cpp b/src/cmd_zline.cpp index 772bac84f..cdb296d16 100644 --- a/src/cmd_zline.cpp +++ b/src/cmd_zline.cpp @@ -35,17 +35,17 @@ void cmd_zline::Handle (const char** parameters, int pcnt, userrec *user) user->WriteServ("NOTICE %s :*** You cannot include a username in a zline, a zline must ban only an IP mask",user->nick); return; } - if (ServerInstance->ip_matches_everyone(parameters[0],user)) + if (ServerInstance->IPMatchesEveryone(parameters[0],user)) return; - ServerInstance->XLines->add_zline(ServerInstance->duration(parameters[1]),user->nick,parameters[2],parameters[0]); - FOREACH_MOD(I_OnAddZLine,OnAddZLine(ServerInstance->duration(parameters[1]), user, parameters[2], parameters[0])); - if (!ServerInstance->duration(parameters[1])) + ServerInstance->XLines->add_zline(ServerInstance->Duration(parameters[1]),user->nick,parameters[2],parameters[0]); + FOREACH_MOD(I_OnAddZLine,OnAddZLine(ServerInstance->Duration(parameters[1]), user, parameters[2], parameters[0])); + if (!ServerInstance->Duration(parameters[1])) { ServerInstance->WriteOpers("*** %s added permanent Z-line for %s.",user->nick,parameters[0]); } else { - ServerInstance->WriteOpers("*** %s added timed Z-line for %s, expires in %d seconds.",user->nick,parameters[0],ServerInstance->duration(parameters[1])); + ServerInstance->WriteOpers("*** %s added timed Z-line for %s, expires in %d seconds.",user->nick,parameters[0],ServerInstance->Duration(parameters[1])); } ServerInstance->XLines->apply_lines(APPLY_ZLINES); } diff --git a/src/command_parse.cpp b/src/command_parse.cpp index 2c3a482cb..e3d47e9b7 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -134,7 +134,7 @@ bool CommandParser::IsValidCommand(const std::string &commandname, int pcnt, use { if (n->second->flags_needed) { - return ((user->HasPermission(commandname)) || (ServerInstance->is_uline(user->server))); + return ((user->HasPermission(commandname)) || (ServerInstance->ULine(user->server))); } return true; } diff --git a/src/commands.cpp b/src/commands.cpp index ca31c86d8..b9f6d2cec 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -50,7 +50,7 @@ #include "command_parse.h" /* XXX - these really belong in helperfuncs perhaps -- w00t */ -bool InspIRCd::is_uline(const char* server) +bool InspIRCd::ULine(const char* server) { if (!server) return false; @@ -60,11 +60,11 @@ bool InspIRCd::is_uline(const char* server) return (find(Config->ulines.begin(),Config->ulines.end(),server) != Config->ulines.end()); } -int InspIRCd::operstrcmp(const char* data,const char* input) +int InspIRCd::OperPassCompare(const char* data,const char* input) { int MOD_RESULT = 0; FOREACH_RESULT_I(this,I_OnOperCompare,OnOperCompare(data,input)) - Log(DEBUG,"operstrcmp: %d",MOD_RESULT); + Log(DEBUG,"OperPassCompare: %d",MOD_RESULT); if (MOD_RESULT == 1) return 0; if (MOD_RESULT == -1) @@ -73,7 +73,7 @@ int InspIRCd::operstrcmp(const char* data,const char* input) return strcmp(data,input); } -long InspIRCd::duration(const char* str) +long InspIRCd::Duration(const char* str) { char n_field[MAXBUF]; long total = 0; @@ -83,7 +83,7 @@ long InspIRCd::duration(const char* str) { std::string n = str; n += 's'; - return duration(n.c_str()); + return Duration(n.c_str()); } for (char* i = (char*)str; *i; i++) @@ -134,7 +134,7 @@ long InspIRCd::duration(const char* str) /* All other ircds when doing this check usually just look for a string of *@* or *. We're smarter than that, though. */ -bool InspIRCd::host_matches_everyone(const std::string &mask, userrec* user) +bool InspIRCd::HostMatchesEveryone(const std::string &mask, userrec* user) { char buffer[MAXBUF]; char itrigger[MAXBUF]; @@ -163,7 +163,7 @@ bool InspIRCd::host_matches_everyone(const std::string &mask, userrec* user) return false; } -bool InspIRCd::ip_matches_everyone(const std::string &ip, userrec* user) +bool InspIRCd::IPMatchesEveryone(const std::string &ip, userrec* user) { char itrigger[MAXBUF]; long matches = 0; @@ -189,7 +189,7 @@ bool InspIRCd::ip_matches_everyone(const std::string &ip, userrec* user) return false; } -bool InspIRCd::nick_matches_everyone(const std::string &nick, userrec* user) +bool InspIRCd::NickMatchesEveryone(const std::string &nick, userrec* user) { char itrigger[MAXBUF]; long matches = 0; diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index 211d1b617..51246199a 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -320,13 +320,13 @@ void InspIRCd::SendError(const char *s) } // this function counts all users connected, wether they are registered or NOT. -int InspIRCd::usercnt() +int InspIRCd::UserCount() { return clientlist.size(); } // this counts only registered users, so that the percentages in /MAP don't mess up when users are sitting in an unregistered state -int InspIRCd::registered_usercount() +int InspIRCd::RegisteredUserCount() { int c = 0; @@ -338,7 +338,7 @@ int InspIRCd::registered_usercount() return c; } -int InspIRCd::usercount_invisible() +int InspIRCd::InvisibleUserCount() { int c = 0; @@ -350,7 +350,7 @@ int InspIRCd::usercount_invisible() return c; } -int InspIRCd::usercount_opers() +int InspIRCd::OperCount() { int c = 0; @@ -362,7 +362,7 @@ int InspIRCd::usercount_opers() return c; } -int InspIRCd::usercount_unknown() +int InspIRCd::UnregisteredUserCount() { int c = 0; @@ -376,12 +376,12 @@ int InspIRCd::usercount_unknown() return c; } -long InspIRCd::chancount() +long InspIRCd::ChannelCount() { return chanlist.size(); } -long InspIRCd::local_count() +long InspIRCd::LocalUserCount() { int c = 0; diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 8680c4197..831ac80a1 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -191,7 +191,7 @@ std::string InspIRCd::GetRevision() } InspIRCd::InspIRCd(int argc, char** argv) - : duration_m(60), duration_h(60*60), duration_d(60*60*24), duration_w(60*60*24*7), duration_y(60*60*24*365), ModCount(-1) + : ModCount(-1), duration_m(60), duration_h(60*60), duration_d(60*60*24), duration_w(60*60*24*7), duration_y(60*60*24*365) { bool SEGVHandler = false; ServerInstance = this; @@ -274,7 +274,7 @@ InspIRCd::InspIRCd(int argc, char** argv) Config->ClearStack(); Config->Read(true, NULL); this->CheckRoot(); - this->ModeGrok = new ModeParser(this); + this->Modes = new ModeParser(this); this->AddServerName(Config->ServerName); CheckDie(); InitializeDisabledCommands(Config->DisabledCommands, this); diff --git a/src/mode.cpp b/src/mode.cpp index ae18959d7..b3886eefe 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -306,7 +306,7 @@ void ModeParser::Process(const char** parameters, int pcnt, userrec *user, bool ServerInstance->Log(DEBUG,"The user is not a halfop or above, checking other reasons for being able to set the modes"); /* Are we a uline or is it a servermode? */ - if ((!ServerInstance->is_uline(user->server)) && (!servermode)) + if ((!ServerInstance->ULine(user->server)) && (!servermode)) { /* Not enough permission: * NOT a uline and NOT a servermode, @@ -489,7 +489,7 @@ void cmd_mode::Handle (const char** parameters, int pcnt, userrec *user) if (!user) return; - ServerInstance->ModeGrok->Process(parameters, pcnt, user, false); + ServerInstance->Modes->Process(parameters, pcnt, user, false); return; } diff --git a/src/modes/cmode_h.cpp b/src/modes/cmode_h.cpp index da810a4d2..cb7c631db 100644 --- a/src/modes/cmode_h.cpp +++ b/src/modes/cmode_h.cpp @@ -67,7 +67,7 @@ ModeAction ModeChannelHalfOp::OnModeChange(userrec* source, userrec* dest, chanr std::string ModeChannelHalfOp::AddHalfOp(userrec *user,const char* dest,chanrec *chan,int status) { - userrec *d = ServerInstance->ModeGrok->SanityChecks(user,dest,chan,status); + userrec *d = ServerInstance->Modes->SanityChecks(user,dest,chan,status); if (d) { @@ -80,7 +80,7 @@ std::string ModeChannelHalfOp::AddHalfOp(userrec *user,const char* dest,chanrec return ""; if (MOD_RESULT == ACR_DEFAULT) { - if ((status < STATUS_OP) && (!ServerInstance->is_uline(user->server))) + if ((status < STATUS_OP) && (!ServerInstance->ULine(user->server))) { user->WriteServ("482 %s %s :You're not a channel operator",user->nick, chan->name); return ""; @@ -88,14 +88,14 @@ std::string ModeChannelHalfOp::AddHalfOp(userrec *user,const char* dest,chanrec } } - return ServerInstance->ModeGrok->Grant(d,chan,UCMODE_HOP); + return ServerInstance->Modes->Grant(d,chan,UCMODE_HOP); } return ""; } std::string ModeChannelHalfOp::DelHalfOp(userrec *user,const char *dest,chanrec *chan,int status) { - userrec *d = ServerInstance->ModeGrok->SanityChecks(user,dest,chan,status); + userrec *d = ServerInstance->Modes->SanityChecks(user,dest,chan,status); if (d) { @@ -108,7 +108,7 @@ std::string ModeChannelHalfOp::DelHalfOp(userrec *user,const char *dest,chanrec return ""; if (MOD_RESULT == ACR_DEFAULT) { - if ((user != d) && ((status < STATUS_OP) && (!ServerInstance->is_uline(user->server)))) + if ((user != d) && ((status < STATUS_OP) && (!ServerInstance->ULine(user->server)))) { user->WriteServ("482 %s %s :You are not a channel operator",user->nick, chan->name); return ""; @@ -116,7 +116,7 @@ std::string ModeChannelHalfOp::DelHalfOp(userrec *user,const char *dest,chanrec } } - return ServerInstance->ModeGrok->Revoke(d,chan,UCMODE_HOP); + return ServerInstance->Modes->Revoke(d,chan,UCMODE_HOP); } return ""; } diff --git a/src/modes/cmode_o.cpp b/src/modes/cmode_o.cpp index c8a969b9c..864923506 100644 --- a/src/modes/cmode_o.cpp +++ b/src/modes/cmode_o.cpp @@ -58,7 +58,7 @@ ModeAction ModeChannelOp::OnModeChange(userrec* source, userrec* dest, chanrec* std::string ModeChannelOp::AddOp(userrec *user,const char* dest,chanrec *chan,int status) { - userrec *d = ServerInstance->ModeGrok->SanityChecks(user,dest,chan,status); + userrec *d = ServerInstance->Modes->SanityChecks(user,dest,chan,status); if (d) { @@ -71,7 +71,7 @@ std::string ModeChannelOp::AddOp(userrec *user,const char* dest,chanrec *chan,in return ""; if (MOD_RESULT == ACR_DEFAULT) { - if ((status < STATUS_OP) && (!ServerInstance->is_uline(user->server))) + if ((status < STATUS_OP) && (!ServerInstance->ULine(user->server))) { user->WriteServ("482 %s %s :You're not a channel operator",user->nick, chan->name); return ""; @@ -79,14 +79,14 @@ std::string ModeChannelOp::AddOp(userrec *user,const char* dest,chanrec *chan,in } } - return ServerInstance->ModeGrok->Grant(d,chan,UCMODE_OP); + return ServerInstance->Modes->Grant(d,chan,UCMODE_OP); } return ""; } std::string ModeChannelOp::DelOp(userrec *user,const char *dest,chanrec *chan,int status) { - userrec *d = ServerInstance->ModeGrok->SanityChecks(user,dest,chan,status); + userrec *d = ServerInstance->Modes->SanityChecks(user,dest,chan,status); if (d) { @@ -102,7 +102,7 @@ std::string ModeChannelOp::DelOp(userrec *user,const char *dest,chanrec *chan,in return ""; if (MOD_RESULT == ACR_DEFAULT) { - if ((status < STATUS_OP) && (!ServerInstance->is_uline(user->server)) && (IS_LOCAL(user))) + if ((status < STATUS_OP) && (!ServerInstance->ULine(user->server)) && (IS_LOCAL(user))) { user->WriteServ("482 %s %s :You are not a channel operator",user->nick, chan->name); return ""; @@ -110,7 +110,7 @@ std::string ModeChannelOp::DelOp(userrec *user,const char *dest,chanrec *chan,in } } - return ServerInstance->ModeGrok->Revoke(d,chan,UCMODE_OP); + return ServerInstance->Modes->Revoke(d,chan,UCMODE_OP); } return ""; } diff --git a/src/modes/cmode_v.cpp b/src/modes/cmode_v.cpp index 3f2910e1d..171e845fd 100644 --- a/src/modes/cmode_v.cpp +++ b/src/modes/cmode_v.cpp @@ -58,7 +58,7 @@ ModeAction ModeChannelVoice::OnModeChange(userrec* source, userrec* dest, chanre std::string ModeChannelVoice::AddVoice(userrec *user,const char* dest,chanrec *chan,int status) { - userrec *d = ServerInstance->ModeGrok->SanityChecks(user,dest,chan,status); + userrec *d = ServerInstance->Modes->SanityChecks(user,dest,chan,status); if (d) { @@ -71,7 +71,7 @@ std::string ModeChannelVoice::AddVoice(userrec *user,const char* dest,chanrec *c return ""; if (MOD_RESULT == ACR_DEFAULT) { - if ((status < STATUS_HOP) && (!ServerInstance->is_uline(user->server))) + if ((status < STATUS_HOP) && (!ServerInstance->ULine(user->server))) { user->WriteServ("482 %s %s :You're not a channel (half)operator",user->nick, chan->name); return ""; @@ -79,14 +79,14 @@ std::string ModeChannelVoice::AddVoice(userrec *user,const char* dest,chanrec *c } } - return ServerInstance->ModeGrok->Grant(d,chan,UCMODE_VOICE); + return ServerInstance->Modes->Grant(d,chan,UCMODE_VOICE); } return ""; } std::string ModeChannelVoice::DelVoice(userrec *user,const char *dest,chanrec *chan,int status) { - userrec *d = ServerInstance->ModeGrok->SanityChecks(user,dest,chan,status); + userrec *d = ServerInstance->Modes->SanityChecks(user,dest,chan,status); if (d) { @@ -99,7 +99,7 @@ std::string ModeChannelVoice::DelVoice(userrec *user,const char *dest,chanrec *c return ""; if (MOD_RESULT == ACR_DEFAULT) { - if ((status < STATUS_HOP) && (!ServerInstance->is_uline(user->server))) + if ((status < STATUS_HOP) && (!ServerInstance->ULine(user->server))) { user->WriteServ("482 %s %s :You are not a channel (half)operator",user->nick, chan->name); return ""; @@ -107,7 +107,7 @@ std::string ModeChannelVoice::DelVoice(userrec *user,const char *dest,chanrec *c } } - return ServerInstance->ModeGrok->Revoke(d,chan,UCMODE_VOICE); + return ServerInstance->Modes->Revoke(d,chan,UCMODE_VOICE); } return ""; } diff --git a/src/modules.cpp b/src/modules.cpp index 94ba661e0..fc49d622f 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -359,7 +359,7 @@ void InspIRCd::AddCommand(command_t *f) void InspIRCd::SendMode(const char** parameters, int pcnt, userrec *user) { - this->ModeGrok->Process(parameters,pcnt,user,true); + this->Modes->Process(parameters,pcnt,user,true); } void InspIRCd::DumpText(userrec* User, const std::string &LinePrefix, stringstream &TextStream) @@ -385,17 +385,17 @@ userrec* InspIRCd::FindDescriptor(int socket) bool InspIRCd::AddMode(ModeHandler* mh, const unsigned char mode) { - return this->ModeGrok->AddMode(mh,mode); + return this->Modes->AddMode(mh,mode); } bool InspIRCd::AddModeWatcher(ModeWatcher* mw) { - return this->ModeGrok->AddModeWatcher(mw); + return this->Modes->AddModeWatcher(mw); } bool InspIRCd::DelModeWatcher(ModeWatcher* mw) { - return this->ModeGrok->DelModeWatcher(mw); + return this->Modes->DelModeWatcher(mw); } bool InspIRCd::AddResolver(Resolver* r) diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp index 7b29cc9f9..5eb7c9908 100644 --- a/src/modules/m_alias.cpp +++ b/src/modules/m_alias.cpp @@ -116,7 +116,7 @@ class ModuleAlias : public Module } if ((u != NULL) && (Aliases[i].requires != "") && (Aliases[i].uline)) { - if (!ServerInstance->is_uline(u->server)) + if (!ServerInstance->ULine(u->server)) { ServerInstance->WriteOpers("*** NOTICE -- Service "+Aliases[i].requires+" required by alias "+std::string(Aliases[i].text.c_str())+" is not on a u-lined server, possibly underhanded antics detected!"); user->WriteServ("401 "+std::string(user->nick)+" "+Aliases[i].requires+" :is an imposter! Please inform an IRC operator as soon as possible."); diff --git a/src/modules/m_banexception.cpp b/src/modules/m_banexception.cpp index 36021a6a4..cc3bf0730 100644 --- a/src/modules/m_banexception.cpp +++ b/src/modules/m_banexception.cpp @@ -49,7 +49,7 @@ public: virtual void On005Numeric(std::string &output) { output.append(" EXCEPTS=e"); - ServerInstance->ModeGrok->InsertMode(output, "e", 1); + ServerInstance->Modes->InsertMode(output, "e", 1); } virtual int OnCheckBan(userrec* user, chanrec* chan) diff --git a/src/modules/m_blockcaps.cpp b/src/modules/m_blockcaps.cpp index 655643ed8..1e9095a83 100644 --- a/src/modules/m_blockcaps.cpp +++ b/src/modules/m_blockcaps.cpp @@ -74,7 +74,7 @@ public: virtual void On005Numeric(std::string &output) { - ServerInstance->ModeGrok->InsertMode(output, "P", 4); + ServerInstance->Modes->InsertMode(output, "P", 4); } virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status) diff --git a/src/modules/m_blockcolor.cpp b/src/modules/m_blockcolor.cpp index ddba6ee2a..04d9d1e54 100644 --- a/src/modules/m_blockcolor.cpp +++ b/src/modules/m_blockcolor.cpp @@ -76,7 +76,7 @@ class ModuleBlockColour : public Module virtual void On005Numeric(std::string &output) { - ServerInstance->ModeGrok->InsertMode(output,"c",4); + ServerInstance->Modes->InsertMode(output,"c",4); } virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status) diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp index cf2be71d1..19d6e8502 100644 --- a/src/modules/m_cban.cpp +++ b/src/modules/m_cban.cpp @@ -92,7 +92,7 @@ class cmd_cban : public command_t // parameters[0] = #channel // parameters[1] = 1h3m2s // parameters[2] = Tortoise abuser - long length = ServerInstance->duration(parameters[1]); + long length = ServerInstance->Duration(parameters[1]); std::string reason = (pcnt > 2) ? parameters[2] : "No reason supplied"; cbans.push_back(CBan(parameters[0], user->nick, ServerInstance->Time(), length, reason)); diff --git a/src/modules/m_censor.cpp b/src/modules/m_censor.cpp index d227a2347..e68886a34 100644 --- a/src/modules/m_censor.cpp +++ b/src/modules/m_censor.cpp @@ -139,7 +139,7 @@ class ModuleCensor : public Module virtual void On005Numeric(std::string &output) { - ServerInstance->ModeGrok->InsertMode(output,"G",4); + ServerInstance->Modes->InsertMode(output,"G",4); } virtual ~ModuleCensor() diff --git a/src/modules/m_chanfilter.cpp b/src/modules/m_chanfilter.cpp index 138df4aa9..c835da180 100644 --- a/src/modules/m_chanfilter.cpp +++ b/src/modules/m_chanfilter.cpp @@ -86,7 +86,7 @@ class ModuleChanFilter : public Module virtual void On005Numeric(std::string &output) { - ServerInstance->ModeGrok->InsertMode(output,"g",1); + ServerInstance->Modes->InsertMode(output,"g",1); } virtual void OnChannelDelete(chanrec* chan) diff --git a/src/modules/m_chanprotect.cpp b/src/modules/m_chanprotect.cpp index 68a4afb9f..13a9957cb 100644 --- a/src/modules/m_chanprotect.cpp +++ b/src/modules/m_chanprotect.cpp @@ -85,7 +85,7 @@ class ChanFounder : public ModeHandler std::string founder = "cm_founder_"+std::string(channel->name); // source is a server, or ulined, we'll let them +-q the user. - if ((ServerInstance->is_uline(source->nick)) || (ServerInstance->is_uline(source->server)) || (!*source->server) || (!IS_LOCAL(source))) + if ((ServerInstance->ULine(source->nick)) || (ServerInstance->ULine(source->server)) || (!*source->server) || (!IS_LOCAL(source))) { ServerInstance->Log(DEBUG,"Allowing remote mode change in ChanFounder"); if (adding) @@ -194,7 +194,7 @@ class ChanProtect : public ModeHandler std::string founder = "cm_founder_"+std::string(channel->name); // source has +q, is a server, or ulined, we'll let them +-a the user. - if ((ServerInstance->is_uline(source->nick)) || (ServerInstance->is_uline(source->server)) || (!*source->server) || (source->GetExt(founder,dummyptr)) || (!IS_LOCAL(source))) + if ((ServerInstance->ULine(source->nick)) || (ServerInstance->ULine(source->server)) || (!*source->server) || (source->GetExt(founder,dummyptr)) || (!IS_LOCAL(source))) { if (adding) { @@ -273,7 +273,7 @@ class ModuleChanProtect : public Module virtual void On005Numeric(std::string &output) { - ServerInstance->ModeGrok->InsertMode(output,"qa",1); + ServerInstance->Modes->InsertMode(output,"qa",1); } virtual void OnUserKick(userrec* source, userrec* user, chanrec* chan, const std::string &reason) @@ -343,7 +343,7 @@ class ModuleChanProtect : public Module // firstly, if a ulined nick, or a server, is setting the mode, then allow them to set the mode // without any access checks, we're not worthy :p - if ((ServerInstance->is_uline(source->nick)) || (ServerInstance->is_uline(source->server)) || (!*source->server)) + if ((ServerInstance->ULine(source->nick)) || (ServerInstance->ULine(source->server)) || (!*source->server)) { return ACR_ALLOW; } diff --git a/src/modules/m_chghost.cpp b/src/modules/m_chghost.cpp index ac16f137e..d3c3dc84f 100644 --- a/src/modules/m_chghost.cpp +++ b/src/modules/m_chghost.cpp @@ -60,7 +60,7 @@ class cmd_chghost : public command_t userrec* dest = ServerInstance->FindNick(parameters[0]); if (dest) { - if ((dest->ChangeDisplayedHost(parameters[1])) && (!ServerInstance->is_uline(user->server))) + if ((dest->ChangeDisplayedHost(parameters[1])) && (!ServerInstance->ULine(user->server))) { // fix by brain - ulines set hosts silently ServerInstance->WriteOpers(std::string(user->nick)+" used CHGHOST to make the displayed host of "+dest->nick+" become "+parameters[1]); diff --git a/src/modules/m_inviteexception.cpp b/src/modules/m_inviteexception.cpp index f9f3c63af..0f2748b0a 100644 --- a/src/modules/m_inviteexception.cpp +++ b/src/modules/m_inviteexception.cpp @@ -48,7 +48,7 @@ public: virtual void On005Numeric(std::string &output) { output.append(" INVEX=I"); - ServerInstance->ModeGrok->InsertMode(output, "I", 1); + ServerInstance->Modes->InsertMode(output, "I", 1); } virtual int OnCheckInvite(userrec* user, chanrec* chan) diff --git a/src/modules/m_joinflood.cpp b/src/modules/m_joinflood.cpp index 9a49cf6b1..e4d528159 100644 --- a/src/modules/m_joinflood.cpp +++ b/src/modules/m_joinflood.cpp @@ -245,7 +245,7 @@ class ModuleJoinFlood : public Module virtual void On005Numeric(std::string &output) { - ServerInstance->ModeGrok->InsertMode(output, "j", 3); + ServerInstance->Modes->InsertMode(output, "j", 3); } virtual ~ModuleJoinFlood() diff --git a/src/modules/m_kicknorejoin.cpp b/src/modules/m_kicknorejoin.cpp index 12b09ea30..86f53fae7 100644 --- a/src/modules/m_kicknorejoin.cpp +++ b/src/modules/m_kicknorejoin.cpp @@ -168,7 +168,7 @@ public: virtual void On005Numeric(std::string &output) { - ServerInstance->ModeGrok->InsertMode(output, "J", 3); + ServerInstance->Modes->InsertMode(output, "J", 3); } virtual ~ModuleKickNoRejoin() diff --git a/src/modules/m_knock.cpp b/src/modules/m_knock.cpp index afc3cfa02..25286f4c5 100644 --- a/src/modules/m_knock.cpp +++ b/src/modules/m_knock.cpp @@ -125,7 +125,7 @@ class ModuleKnock : public Module virtual void On005Numeric(std::string &output) { - ServerInstance->ModeGrok->InsertMode(output,"K",4); + ServerInstance->Modes->InsertMode(output,"K",4); } virtual ~ModuleKnock() diff --git a/src/modules/m_messageflood.cpp b/src/modules/m_messageflood.cpp index 0f2bb23c6..ce10daed2 100644 --- a/src/modules/m_messageflood.cpp +++ b/src/modules/m_messageflood.cpp @@ -265,7 +265,7 @@ class ModuleMsgFlood : public Module virtual void On005Numeric(std::string &output) { - ServerInstance->ModeGrok->InsertMode(output, "f", 3); + ServerInstance->Modes->InsertMode(output, "f", 3); } virtual ~ModuleMsgFlood() diff --git a/src/modules/m_noctcp.cpp b/src/modules/m_noctcp.cpp index a01862f70..666143a04 100644 --- a/src/modules/m_noctcp.cpp +++ b/src/modules/m_noctcp.cpp @@ -77,7 +77,7 @@ class ModuleNoCTCP : public Module virtual void On005Numeric(std::string &output) { - ServerInstance->ModeGrok->InsertMode(output,"C",4); + ServerInstance->Modes->InsertMode(output,"C",4); } virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status) diff --git a/src/modules/m_noinvite.cpp b/src/modules/m_noinvite.cpp index 860ec17d2..b2878830e 100644 --- a/src/modules/m_noinvite.cpp +++ b/src/modules/m_noinvite.cpp @@ -76,7 +76,7 @@ class ModuleNoInvite : public Module virtual void On005Numeric(std::string &output) { - ServerInstance->ModeGrok->InsertMode(output,"V",4); + ServerInstance->Modes->InsertMode(output,"V",4); } diff --git a/src/modules/m_nokicks.cpp b/src/modules/m_nokicks.cpp index 656e5d0a8..1606ca026 100644 --- a/src/modules/m_nokicks.cpp +++ b/src/modules/m_nokicks.cpp @@ -77,7 +77,7 @@ class ModuleNoKicks : public Module virtual void On005Numeric(std::string &output) { - ServerInstance->ModeGrok->InsertMode(output,"Q",4); + ServerInstance->Modes->InsertMode(output,"Q",4); } virtual int OnAccessCheck(userrec* source,userrec* dest,chanrec* channel,int access_type) @@ -86,7 +86,7 @@ class ModuleNoKicks : public Module { if (channel->IsModeSet('Q')) { - if ((ServerInstance->is_uline(source->nick)) || (ServerInstance->is_uline(source->server)) || (!*source->server)) + if ((ServerInstance->ULine(source->nick)) || (ServerInstance->ULine(source->server)) || (!*source->server)) { // ulines can still kick with +Q in place return ACR_ALLOW; diff --git a/src/modules/m_nonicks.cpp b/src/modules/m_nonicks.cpp index ff99f8eed..d8f974c9f 100644 --- a/src/modules/m_nonicks.cpp +++ b/src/modules/m_nonicks.cpp @@ -89,7 +89,7 @@ class ModuleNoNickChange : public Module virtual void On005Numeric(std::string &output) { - ServerInstance->ModeGrok->InsertMode(output,"N",4); + ServerInstance->Modes->InsertMode(output,"N",4); } virtual int OnUserPreNick(userrec* user, const std::string &newnick) diff --git a/src/modules/m_nonotice.cpp b/src/modules/m_nonotice.cpp index 6f37640c2..1c0948f12 100644 --- a/src/modules/m_nonotice.cpp +++ b/src/modules/m_nonotice.cpp @@ -81,7 +81,7 @@ class ModuleNoNotice : public Module chanrec* c = (chanrec*)dest; if (c->IsModeSet('T')) { - if ((ServerInstance->is_uline(user->server)) || (c->GetStatus(user) == STATUS_OP) || (c->GetStatus(user) == STATUS_HOP)) + if ((ServerInstance->ULine(user->server)) || (c->GetStatus(user) == STATUS_OP) || (c->GetStatus(user) == STATUS_HOP)) { // ops and halfops can still /NOTICE the channel return 0; @@ -98,7 +98,7 @@ class ModuleNoNotice : public Module virtual void On005Numeric(std::string &output) { - ServerInstance->ModeGrok->InsertMode(output,"T",4); + ServerInstance->Modes->InsertMode(output,"T",4); } virtual ~ModuleNoNotice() diff --git a/src/modules/m_operchans.cpp b/src/modules/m_operchans.cpp index 3adff3c6b..def8452b4 100644 --- a/src/modules/m_operchans.cpp +++ b/src/modules/m_operchans.cpp @@ -76,7 +76,7 @@ class ModuleOperChans : public Module virtual void On005Numeric(std::string &output) { - ServerInstance->ModeGrok->InsertMode(output,"O",4); + ServerInstance->Modes->InsertMode(output,"O",4); } virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname) diff --git a/src/modules/m_redirect.cpp b/src/modules/m_redirect.cpp index 7d887e100..4f9aa0c2a 100644 --- a/src/modules/m_redirect.cpp +++ b/src/modules/m_redirect.cpp @@ -125,7 +125,7 @@ class ModuleRedirect : public Module virtual void On005Numeric(std::string &output) { - ServerInstance->ModeGrok->InsertMode(output, "L", 3); + ServerInstance->Modes->InsertMode(output, "L", 3); } virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname) diff --git a/src/modules/m_remove.cpp b/src/modules/m_remove.cpp index 18bddd015..8e26f6ead 100644 --- a/src/modules/m_remove.cpp +++ b/src/modules/m_remove.cpp @@ -109,7 +109,7 @@ class RemoveBase protectkey = "cm_protect_" + std::string(channel->name); founderkey = "cm_founder_" + std::string(channel->name); - if (ServerInstance->is_uline(user->server) || ServerInstance->is_uline(user->nick)) + if (ServerInstance->ULine(user->server) || ServerInstance->ULine(user->nick)) { ServerInstance->Log(DEBUG, "Setting ulevel to U"); ulevel = chartolevel("U"); @@ -131,7 +131,7 @@ class RemoveBase } /* Now it's the same idea, except for the target. If they're ulined make sure they get a higher level than the sender can */ - if (ServerInstance->is_uline(target->server) || ServerInstance->is_uline(target->nick)) + if (ServerInstance->ULine(target->server) || ServerInstance->ULine(target->nick)) { ServerInstance->Log(DEBUG, "Setting tlevel to U"); tlevel = chartolevel("U"); diff --git a/src/modules/m_sajoin.cpp b/src/modules/m_sajoin.cpp index 0d998abd9..3dfbc7efe 100644 --- a/src/modules/m_sajoin.cpp +++ b/src/modules/m_sajoin.cpp @@ -43,7 +43,7 @@ class cmd_sajoin : public command_t userrec* dest = ServerInstance->FindNick(parameters[0]); if (dest) { - if (ServerInstance->is_uline(dest->server)) + if (ServerInstance->ULine(dest->server)) { user->WriteServ("990 %s :Cannot use an SA command on a u-lined client",user->nick); return; diff --git a/src/modules/m_sanick.cpp b/src/modules/m_sanick.cpp index 5758bac64..818672ce4 100644 --- a/src/modules/m_sanick.cpp +++ b/src/modules/m_sanick.cpp @@ -42,7 +42,7 @@ class cmd_sanick : public command_t userrec* source = ServerInstance->FindNick(parameters[0]); if (source) { - if (ServerInstance->is_uline(source->server)) + if (ServerInstance->ULine(source->server)) { user->WriteServ("990 %s :Cannot use an SA command on a u-lined client",user->nick); return; diff --git a/src/modules/m_sapart.cpp b/src/modules/m_sapart.cpp index 9d20ed638..3120783cf 100644 --- a/src/modules/m_sapart.cpp +++ b/src/modules/m_sapart.cpp @@ -44,7 +44,7 @@ class cmd_sapart : public command_t chanrec* channel = ServerInstance->FindChan(parameters[1]); if (dest && channel) { - if (ServerInstance->is_uline(dest->server)) + if (ServerInstance->ULine(dest->server)) { user->WriteServ("990 %s :Cannot use an SA command on a u-lined client",user->nick); return; diff --git a/src/modules/m_saquit.cpp b/src/modules/m_saquit.cpp index 0a6155b27..1152a2ea2 100644 --- a/src/modules/m_saquit.cpp +++ b/src/modules/m_saquit.cpp @@ -52,7 +52,7 @@ class cmd_saquit : public command_t userrec* dest = ServerInstance->FindNick(parameters[0]); if (dest) { - if (ServerInstance->is_uline(dest->server)) + if (ServerInstance->ULine(dest->server)) { user->WriteServ("990 %s :Cannot use an SA command on a u-lined client",user->nick); return; diff --git a/src/modules/m_services.cpp b/src/modules/m_services.cpp index 40e160a6c..21ab31f6b 100644 --- a/src/modules/m_services.cpp +++ b/src/modules/m_services.cpp @@ -41,7 +41,7 @@ class Channel_r : public ModeHandler ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding) { // only a u-lined server may add or remove the +r mode. - if ((ServerInstance->is_uline(source->nick)) || (ServerInstance->is_uline(source->server)) || (!*source->server || (strchr(source->nick,'.')))) + if ((ServerInstance->ULine(source->nick)) || (ServerInstance->ULine(source->server)) || (!*source->server || (strchr(source->nick,'.')))) { ServerInstance->Log(DEBUG,"Allowing cmode +r, server and nick are: '%s','%s'",source->nick,source->server); channel->SetMode('r',adding); @@ -64,7 +64,7 @@ class User_r : public ModeHandler ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding) { - if ((kludgeme) || (ServerInstance->is_uline(source->nick)) || (ServerInstance->is_uline(source->server)) || (!*source->server || (strchr(source->nick,'.')))) + if ((kludgeme) || (ServerInstance->ULine(source->nick)) || (ServerInstance->ULine(source->server)) || (!*source->server || (strchr(source->nick,'.')))) { ServerInstance->Log(DEBUG,"Allowing umode +r, server and nick are: '%s','%s'",source->nick,source->server); dest->SetMode('r',adding); @@ -191,7 +191,7 @@ class ModuleServices : public Module virtual void On005Numeric(std::string &output) { - ServerInstance->ModeGrok->InsertMode(output, "rRM", 4); + ServerInstance->Modes->InsertMode(output, "rRM", 4); } /* <- :stitch.chatspike.net 307 w00t w00t :is a registered nick */ @@ -230,7 +230,7 @@ class ModuleServices : public Module chanrec* c = (chanrec*)dest; if ((c->IsModeSet('M')) && (!user->IsModeSet('r'))) { - if ((ServerInstance->is_uline(user->nick)) || (ServerInstance->is_uline(user->server)) || (!strcmp(user->server,""))) + if ((ServerInstance->ULine(user->nick)) || (ServerInstance->ULine(user->server)) || (!strcmp(user->server,""))) { // user is ulined, can speak regardless return 0; @@ -245,7 +245,7 @@ class ModuleServices : public Module userrec* u = (userrec*)dest; if ((u->IsModeSet('R')) && (user->IsModeSet('r'))) { - if ((ServerInstance->is_uline(user->nick)) || (ServerInstance->is_uline(user->server))) + if ((ServerInstance->ULine(user->nick)) || (ServerInstance->ULine(user->server))) { // user is ulined, can speak regardless return 0; @@ -271,7 +271,7 @@ class ModuleServices : public Module { if (user->IsModeSet('r')) { - if ((ServerInstance->is_uline(user->nick)) || (ServerInstance->is_uline(user->server))) + if ((ServerInstance->ULine(user->nick)) || (ServerInstance->ULine(user->server))) { // user is ulined, won't be stopped from joining return 0; diff --git a/src/modules/m_services_account.cpp b/src/modules/m_services_account.cpp index 0d7ff4339..d3a16fa05 100644 --- a/src/modules/m_services_account.cpp +++ b/src/modules/m_services_account.cpp @@ -133,7 +133,7 @@ class ModuleServicesAccount : public Module virtual void On005Numeric(std::string &output) { - ServerInstance->ModeGrok->InsertMode(output, "RM", 4); + ServerInstance->Modes->InsertMode(output, "RM", 4); } /* <- :twisted.oscnet.org 330 w00t2 w00t2 w00t :is logged in as */ @@ -165,7 +165,7 @@ class ModuleServicesAccount : public Module if ((c->IsModeSet('M')) && (!account)) { - if ((ServerInstance->is_uline(user->nick)) || (ServerInstance->is_uline(user->server)) || (!strcmp(user->server,""))) + if ((ServerInstance->ULine(user->nick)) || (ServerInstance->ULine(user->server)) || (!strcmp(user->server,""))) { // user is ulined, can speak regardless return 0; @@ -182,7 +182,7 @@ class ModuleServicesAccount : public Module if ((u->modes['R'-65]) && (!account)) { - if ((ServerInstance->is_uline(user->nick)) || (ServerInstance->is_uline(user->server))) + if ((ServerInstance->ULine(user->nick)) || (ServerInstance->ULine(user->server))) { // user is ulined, can speak regardless return 0; @@ -212,7 +212,7 @@ class ModuleServicesAccount : public Module { if (!account) { - if ((ServerInstance->is_uline(user->nick)) || (ServerInstance->is_uline(user->server))) + if ((ServerInstance->ULine(user->nick)) || (ServerInstance->ULine(user->server))) { // user is ulined, won't be stopped from joining return 0; diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index b9e15143d..8aa3e2b65 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -1007,7 +1007,7 @@ class TreeSocket : public InspSocket /* We only care about whats being set, * not whats being unset */ - mh = this->Instance->ModeGrok->FindMode(*x, chan ? MODETYPE_CHANNEL : MODETYPE_USER); + mh = this->Instance->Modes->FindMode(*x, chan ? MODETYPE_CHANNEL : MODETYPE_USER); if ((mh) && (mh->GetNumParams(adding) > 0) && (!mh->IsListMode())) { @@ -1072,7 +1072,7 @@ class TreeSocket : public InspSocket } else { - mh = this->Instance->ModeGrok->FindMode(*x, chan ? MODETYPE_CHANNEL : MODETYPE_USER); + mh = this->Instance->Modes->FindMode(*x, chan ? MODETYPE_CHANNEL : MODETYPE_USER); if (mh) { @@ -1097,7 +1097,7 @@ class TreeSocket : public InspSocket } else { - mh = this->Instance->ModeGrok->FindMode(*x, chan ? MODETYPE_CHANNEL : MODETYPE_USER); + mh = this->Instance->Modes->FindMode(*x, chan ? MODETYPE_CHANNEL : MODETYPE_USER); if (mh) { @@ -1159,7 +1159,7 @@ class TreeSocket : public InspSocket } else /* U-lined servers always win regardless of their TS */ - if ((TS > ourTS) && (!this->Instance->is_uline(source.c_str()))) + if ((TS > ourTS) && (!this->Instance->ULine(source.c_str()))) { /* Bounce the mode back to its sender.* We use our lower TS, so the other end * SHOULD accept it, if its clock is right. @@ -1204,7 +1204,7 @@ class TreeSocket : public InspSocket break; default: /* Find the mode handler for this mode */ - mh = this->Instance->ModeGrok->FindMode(*x, chan ? MODETYPE_CHANNEL : MODETYPE_USER); + mh = this->Instance->Modes->FindMode(*x, chan ? MODETYPE_CHANNEL : MODETYPE_USER); /* Got a mode handler? * This also prevents us bouncing modes we have no handler for. @@ -1272,7 +1272,7 @@ class TreeSocket : public InspSocket /* The server was ulined, but something iffy is up with the TS. * Sound the alarm bells! */ - if ((this->Instance->is_uline(sourceserv.c_str())) && (TS > ourTS)) + if ((this->Instance->ULine(sourceserv.c_str())) && (TS > ourTS)) { this->Instance->WriteOpers("\2WARNING!\2 U-Lined server '%s' has bad TS for '%s' (accepted change): \2SYNC YOUR CLOCKS\2 to avoid this notice",sourceserv.c_str(),params[0].c_str()); } @@ -1416,7 +1416,7 @@ class TreeSocket : public InspSocket /* theres a mode for this user. push them onto the mode queue, and flush it * if there are more than MAXMODES to go. */ - if ((ourTS >= TS) || (this->Instance->is_uline(who->server))) + if ((ourTS >= TS) || (this->Instance->ULine(who->server))) { /* We also always let u-lined clients win, no matter what the TS value */ ServerInstance->Log(DEBUG,"Our our channel newer than theirs, accepting their modes"); @@ -3427,7 +3427,7 @@ class ModuleSpanningTree : public Module } for (unsigned int q = 0; q < Current->ChildCount(); q++) { - if ((HideULines) && (ServerInstance->is_uline(Current->GetChild(q)->GetName().c_str()))) + if ((HideULines) && (ServerInstance->ULine(Current->GetChild(q)->GetName().c_str()))) { if (*user->oper) { @@ -3440,7 +3440,7 @@ class ModuleSpanningTree : public Module } } /* Don't display the line if its a uline, hide ulines is on, and the user isnt an oper */ - if ((HideULines) && (ServerInstance->is_uline(Current->GetName().c_str())) && (!*user->oper)) + if ((HideULines) && (ServerInstance->ULine(Current->GetName().c_str())) && (!*user->oper)) return; user->WriteServ("364 %s %s %s :%d %s",user->nick,Current->GetName().c_str(),(FlatLinks && (!*user->oper)) ? ServerInstance->Config->ServerName : Parent.c_str(),(FlatLinks && (!*user->oper)) ? 0 : hops,Current->GetDesc().c_str()); } @@ -3464,23 +3464,23 @@ class ModuleSpanningTree : public Module void HandleLusers(const char** parameters, int pcnt, userrec* user) { - unsigned int n_users = ServerInstance->usercnt(); + unsigned int n_users = ServerInstance->UserCount(); /* Only update these when someone wants to see them, more efficient */ - if ((unsigned int)ServerInstance->local_count() > max_local) - max_local = ServerInstance->local_count(); + if ((unsigned int)ServerInstance->LocalUserCount() > max_local) + max_local = ServerInstance->LocalUserCount(); if (n_users > max_global) max_global = n_users; - user->WriteServ("251 %s :There are %d users and %d invisible on %d servers",user->nick,n_users-ServerInstance->usercount_invisible(),ServerInstance->usercount_invisible(),this->CountServs()); - if (ServerInstance->usercount_opers()) - user->WriteServ("252 %s %d :operator(s) online",user->nick,ServerInstance->usercount_opers()); - if (ServerInstance->usercount_unknown()) - user->WriteServ("253 %s %d :unknown connections",user->nick,ServerInstance->usercount_unknown()); - if (ServerInstance->chancount()) - user->WriteServ("254 %s %d :channels formed",user->nick,ServerInstance->chancount()); - user->WriteServ("254 %s :I have %d clients and %d servers",user->nick,ServerInstance->local_count(),this->CountLocalServs()); - user->WriteServ("265 %s :Current Local Users: %d Max: %d",user->nick,ServerInstance->local_count(),max_local); + user->WriteServ("251 %s :There are %d users and %d invisible on %d servers",user->nick,n_users-ServerInstance->InvisibleUserCount(),ServerInstance->InvisibleUserCount(),this->CountServs()); + if (ServerInstance->OperCount()) + user->WriteServ("252 %s %d :operator(s) online",user->nick,ServerInstance->OperCount()); + if (ServerInstance->UnregisteredUserCount()) + user->WriteServ("253 %s %d :unknown connections",user->nick,ServerInstance->UnregisteredUserCount()); + if (ServerInstance->ChannelCount()) + user->WriteServ("254 %s %d :channels formed",user->nick,ServerInstance->ChannelCount()); + user->WriteServ("254 %s :I have %d clients and %d servers",user->nick,ServerInstance->LocalUserCount(),this->CountLocalServs()); + user->WriteServ("265 %s :Current Local Users: %d Max: %d",user->nick,ServerInstance->LocalUserCount(),max_local); user->WriteServ("266 %s :Current Global Users: %d Max: %d",user->nick,n_users,max_global); return; } @@ -3526,7 +3526,7 @@ class ModuleSpanningTree : public Module line++; for (unsigned int q = 0; q < Current->ChildCount(); q++) { - if ((HideULines) && (ServerInstance->is_uline(Current->GetChild(q)->GetName().c_str()))) + if ((HideULines) && (ServerInstance->ULine(Current->GetChild(q)->GetName().c_str()))) { if (*user->oper) { diff --git a/src/modules/m_sslmodes.cpp b/src/modules/m_sslmodes.cpp index 708f1e3ce..55cfd7a16 100644 --- a/src/modules/m_sslmodes.cpp +++ b/src/modules/m_sslmodes.cpp @@ -76,7 +76,7 @@ class ModuleSSLModes : public Module virtual void On005Numeric(std::string &output) { - ServerInstance->ModeGrok->InsertMode(output, "z", 4); + ServerInstance->Modes->InsertMode(output, "z", 4); } virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname) diff --git a/src/modules/m_stripcolor.cpp b/src/modules/m_stripcolor.cpp index 994a50f33..46e577779 100644 --- a/src/modules/m_stripcolor.cpp +++ b/src/modules/m_stripcolor.cpp @@ -120,7 +120,7 @@ class ModuleStripColor : public Module virtual void On005Numeric(std::string &output) { - ServerInstance->ModeGrok->InsertMode(output,"S",4); + ServerInstance->Modes->InsertMode(output,"S",4); } virtual ~ModuleStripColor() diff --git a/src/modules/m_swhois.cpp b/src/modules/m_swhois.cpp index f06a41194..f885a6145 100644 --- a/src/modules/m_swhois.cpp +++ b/src/modules/m_swhois.cpp @@ -55,14 +55,14 @@ class cmd_swhois : public command_t { // We already had it set... - if (!ServerInstance->is_uline(user->server)) + if (!ServerInstance->ULine(user->server)) // Ulines set SWHOISes silently ServerInstance->WriteOpers("*** %s used SWHOIS to set %s's extra whois from '%s' to '%s'", user->nick, dest->nick, text->c_str(), line.c_str()); dest->Shrink("swhois"); DELETE(text); } - else if(!ServerInstance->is_uline(user->server)) + else if(!ServerInstance->ULine(user->server)) { // Ulines set SWHOISes silently ServerInstance->WriteOpers("*** %s used SWHOIS to set %s's extra whois to '%s'", user->nick, dest->nick, line.c_str()); diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp index dc5f8f977..ac993e0a9 100644 --- a/src/modules/m_timedbans.cpp +++ b/src/modules/m_timedbans.cpp @@ -74,14 +74,14 @@ class cmd_tban : public command_t } TimedBan T; std::string channelname = parameters[0]; - unsigned long expire = ServerInstance->duration(parameters[1]) + time(NULL); - if (ServerInstance->duration(parameters[1]) < 1) + unsigned long expire = ServerInstance->Duration(parameters[1]) + time(NULL); + if (ServerInstance->Duration(parameters[1]) < 1) { user->WriteServ("NOTICE "+std::string(user->nick)+" :Invalid ban time"); return; } char duration[MAXBUF]; - snprintf(duration,MAXBUF,"%lu",ServerInstance->duration(parameters[1])); + snprintf(duration,MAXBUF,"%lu",ServerInstance->Duration(parameters[1])); std::string mask = parameters[2]; const char *setban[32]; setban[0] = parameters[0]; diff --git a/src/users.cpp b/src/users.cpp index 9348db1f4..41d25cf53 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -1021,7 +1021,7 @@ void userrec::FullConnect(CullList* Goners) this->WriteServ("001 %s :Welcome to the %s IRC Network %s!%s@%s",this->nick, ServerInstance->Config->Network, this->nick, this->ident, this->host); this->WriteServ("002 %s :Your host is %s, running version %s",this->nick,ServerInstance->Config->ServerName,VERSION); this->WriteServ("003 %s :This server was created %s %s", this->nick, __TIME__, __DATE__); - this->WriteServ("004 %s %s %s %s %s %s", this->nick, ServerInstance->Config->ServerName, VERSION, ServerInstance->ModeGrok->UserModeList().c_str(), ServerInstance->ModeGrok->ChannelModeList().c_str(), ServerInstance->ModeGrok->ParaModeList().c_str()); + this->WriteServ("004 %s %s %s %s %s %s", this->nick, ServerInstance->Config->ServerName, VERSION, ServerInstance->Modes->UserModeList().c_str(), ServerInstance->Modes->ChannelModeList().c_str(), ServerInstance->Modes->ParaModeList().c_str()); // anfl @ #ratbox, efnet reminded me that according to the RFC this cant contain more than 13 tokens per line... // so i'd better split it :) |