diff options
Diffstat (limited to 'src/modules')
32 files changed, 67 insertions, 74 deletions
diff --git a/src/modules/extra/m_sqlauth.cpp b/src/modules/extra/m_sqlauth.cpp index 0e11afa51..3a88c05c9 100644 --- a/src/modules/extra/m_sqlauth.cpp +++ b/src/modules/extra/m_sqlauth.cpp @@ -121,7 +121,7 @@ public: else { if (verbose) - ServerInstance->WriteOpers("Forbidden connection from %s!%s@%s (SQL query failed: %s)", user->nick, user->ident, user->host, req.error.Str()); + ServerInstance->SNO->WriteToSnoMask('O', "Forbidden connection from %s!%s@%s (SQL query failed: %s)", user->nick, user->ident, user->host, req.error.Str()); return false; } } @@ -147,13 +147,13 @@ public: else if (verbose) { /* No rows in result, this means there was no record matching the user */ - ServerInstance->WriteOpers("Forbidden connection from %s!%s@%s (SQL query returned no matches)", user->nick, user->ident, user->host); + ServerInstance->SNO->WriteToSnoMask('O', "Forbidden connection from %s!%s@%s (SQL query returned no matches)", user->nick, user->ident, user->host); user->Extend("sqlauth_failed"); } } else if (verbose) { - ServerInstance->WriteOpers("Forbidden connection from %s!%s@%s (SQL query failed: %s)", user->nick, user->ident, user->host, res->error.Str()); + ServerInstance->SNO->WriteToSnoMask('O', "Forbidden connection from %s!%s@%s (SQL query failed: %s)", user->nick, user->ident, user->host, res->error.Str()); user->Extend("sqlauth_failed"); } } diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp index 9fcf5062d..b52db1b8b 100644 --- a/src/modules/m_alias.cpp +++ b/src/modules/m_alias.cpp @@ -179,7 +179,7 @@ class ModuleAlias : public Module { 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!"); + ServerInstance->SNO->WriteToSnoMask('O', "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."); return 1; } diff --git a/src/modules/m_blockamsg.cpp b/src/modules/m_blockamsg.cpp index 70fb99b9a..13b7ef946 100644 --- a/src/modules/m_blockamsg.cpp +++ b/src/modules/m_blockamsg.cpp @@ -137,7 +137,7 @@ class ModuleBlockAmsg : public Module { // Block it... if(action == IBLOCK_KILLOPERS || action == IBLOCK_NOTICEOPERS) - ServerInstance->WriteOpers("*** %s had an /amsg or /ame denied", user->nick); + ServerInstance->SNO->WriteToSnoMask('O', "%s had an /amsg or /ame denied", user->nick); if(action == IBLOCK_KILL || action == IBLOCK_KILLOPERS) User::QuitUser(ServerInstance, user, "Global message (/amsg or /ame) detected"); diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp index 76f06900f..d7c95f317 100644 --- a/src/modules/m_cban.cpp +++ b/src/modules/m_cban.cpp @@ -91,12 +91,12 @@ class CommandCban : public Command if(length > 0) { user->WriteServ("385 %s %s :Added %lu second channel ban (%s)", user->nick, parameters[0], length, reason.c_str()); - ServerInstance->WriteOpers("*** %s added %lu second channel ban on %s (%s)", user->nick, length, parameters[0], reason.c_str()); + ServerInstance->SNO->WriteToSnoMask('O', "%s added %lu second channel ban on %s (%s)", user->nick, length, parameters[0], reason.c_str()); } else { user->WriteServ("385 %s %s :Added permanent channel ban (%s)", user->nick, parameters[0], reason.c_str()); - ServerInstance->WriteOpers("*** %s added permanent channel ban on %s (%s)", user->nick, parameters[0], reason.c_str()); + ServerInstance->SNO->WriteToSnoMask('O', "%s added permanent channel ban on %s (%s)", user->nick, parameters[0], reason.c_str()); } } else @@ -159,7 +159,7 @@ class ModuleCBan : public Module { // Channel is banned. user->WriteServ( "384 %s %s :Cannot join channel, CBANed (%s)", user->nick, cname, iter->reason.c_str()); - ServerInstance->WriteOpers("*** %s tried to join %s which is CBANed (%s)", user->nick, cname, iter->reason.c_str()); + ServerInstance->SNO->WriteToSnoMask('O', "%s tried to join %s which is CBANed (%s)", user->nick, cname, iter->reason.c_str()); return 1; } } @@ -228,7 +228,7 @@ class ModuleCBan : public Module { if (iter->set_on + iter->length <= ServerInstance->Time()) { - ServerInstance->WriteOpers("*** %li second CBAN on %s (%s) set on %s expired", iter->length, iter->chname.c_str(), iter->reason.c_str(), ServerInstance->TimeString(iter->set_on).c_str()); + ServerInstance->SNO->WriteToSnoMask('O', "%li second CBAN on %s (%s) set on %s expired", iter->length, iter->chname.c_str(), iter->reason.c_str(), ServerInstance->TimeString(iter->set_on).c_str()); cbans.erase(iter); go_again = true; } diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index b971532db..f6437fe79 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -65,7 +65,7 @@ class CommandWebirc : public Command user->Extend("cgiirc_realhost", new std::string(user->host)); user->Extend("cgiirc_realip", new std::string(user->GetIPString())); if (notify) - ServerInstance->WriteOpers("*** Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from %s", user->nick, user->host, parameters[2], user->host); + ServerInstance->SNO->WriteToSnoMask('O', "Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from %s", user->nick, user->host, parameters[2], user->host); user->Extend("cgiirc_webirc_hostname", new std::string(parameters[2])); user->Extend("cgiirc_webirc_ip", new std::string(parameters[3])); return CMD_LOCALONLY; @@ -98,7 +98,7 @@ class CGIResolver : public Resolver if ((them) && (them == ServerInstance->SE->GetRef(theirfd))) { if (notify) - ServerInstance->WriteOpers("*** Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from %s", them->nick, them->host, result.c_str(), typ.c_str()); + ServerInstance->SNO->WriteToSnoMask('O', "Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from %s", them->nick, them->host, result.c_str(), typ.c_str()); strlcpy(them->host, result.c_str(), 63); strlcpy(them->dhost, result.c_str(), 63); @@ -112,7 +112,7 @@ class CGIResolver : public Resolver if ((them) && (them == ServerInstance->SE->GetRef(theirfd))) { if (notify) - ServerInstance->WriteOpers("*** Connecting user %s detected as using CGI:IRC (%s), but their host can't be resolved from their %s!", them->nick, them->host,typ.c_str()); + ServerInstance->SNO->WriteToSnoMask('O', "Connecting user %s detected as using CGI:IRC (%s), but their host can't be resolved from their %s!", them->nick, them->host,typ.c_str()); } } @@ -344,7 +344,7 @@ public: { /* We were given a IP in the password, we don't do DNS so they get this is as their host as well. */ if(NotifyOpers) - ServerInstance->WriteOpers("*** Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from PASS", user->nick, user->host, user->password); + ServerInstance->SNO->WriteToSnoMask('O', "Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from PASS", user->nick, user->host, user->password); } else { @@ -359,14 +359,14 @@ public: catch (...) { if (NotifyOpers) - ServerInstance->WriteOpers("*** Connecting user %s detected as using CGI:IRC (%s), but i could not resolve their hostname!", user->nick, user->host); + ServerInstance->SNO->WriteToSnoMask('O', "Connecting user %s detected as using CGI:IRC (%s), but i could not resolve their hostname!", user->nick, user->host); } } *user->password = 0; /*if(NotifyOpers) - ServerInstance->WriteOpers("*** Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from PASS", user->nick, user->host, user->password);*/ + ServerInstance->SNO->WriteToSnoMask('O', "Connecting user %s detected as using CGI:IRC (%s), changing real host to %s from PASS", user->nick, user->host, user->password);*/ return true; } @@ -424,7 +424,7 @@ public: user->InvalidateCache(); if(NotifyOpers) - ServerInstance->WriteOpers("*** Connecting user %s detected as using CGI:IRC (%s), but i could not resolve their hostname!", user->nick, user->host); + ServerInstance->SNO->WriteToSnoMask('O', "Connecting user %s detected as using CGI:IRC (%s), but i could not resolve their hostname!", user->nick, user->host); } /*strlcpy(user->host, newip, 16); strlcpy(user->dhost, newip, 16); diff --git a/src/modules/m_chanprotect.cpp b/src/modules/m_chanprotect.cpp index 586747dc0..9e307ab00 100644 --- a/src/modules/m_chanprotect.cpp +++ b/src/modules/m_chanprotect.cpp @@ -364,7 +364,7 @@ class ModuleChanProtect : public Module /* These wont fail, we already owned the mode characters before */ ServerInstance->AddMode(cp); ServerInstance->AddMode(cf); - ServerInstance->WriteOpers("*** WARNING: +qa prefixes were enabled or disabled via a REHASH. Clients will probably need to reconnect to pick up this change."); + ServerInstance->SNO->WriteToSnoMask('O', "WARNING: +qa prefixes were enabled or disabled via a REHASH. Clients will probably need to reconnect to pick up this change."); } } diff --git a/src/modules/m_chghost.cpp b/src/modules/m_chghost.cpp index 20b669f22..c6819499b 100644 --- a/src/modules/m_chghost.cpp +++ b/src/modules/m_chghost.cpp @@ -63,7 +63,7 @@ class CommandChghost : public Command 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 "+dest->dhost); + ServerInstance->SNO->WriteToSnoMask('O', std::string(user->nick)+" used CHGHOST to make the displayed host of "+dest->nick+" become "+dest->dhost); } /* route it! */ diff --git a/src/modules/m_chgident.cpp b/src/modules/m_chgident.cpp index 648a0e669..d20533bc0 100644 --- a/src/modules/m_chgident.cpp +++ b/src/modules/m_chgident.cpp @@ -58,7 +58,7 @@ class CommandChgident : public Command dest->ChangeIdent(parameters[1]); if (!ServerInstance->ULine(user->server)) - ServerInstance->WriteOpers("%s used CHGIDENT to change %s's ident to '%s'", user->nick, dest->nick, dest->ident); + ServerInstance->SNO->WriteToSnoMask('O', "%s used CHGIDENT to change %s's ident to '%s'", user->nick, dest->nick, dest->ident); /* route it! */ return CMD_SUCCESS; diff --git a/src/modules/m_chgname.cpp b/src/modules/m_chgname.cpp index b58a4b177..0e4790eef 100644 --- a/src/modules/m_chgname.cpp +++ b/src/modules/m_chgname.cpp @@ -52,7 +52,7 @@ class CommandChgname : public Command if (IS_LOCAL(dest)) { dest->ChangeName(parameters[1]); - ServerInstance->WriteOpers("%s used CHGNAME to change %s's real name to '%s'", user->nick, dest->nick, dest->fullname); + ServerInstance->SNO->WriteToSnoMask('O', "%s used CHGNAME to change %s's real name to '%s'", user->nick, dest->nick, dest->fullname); return CMD_LOCALONLY; /* name change routed by FNAME in spanningtree now */ } diff --git a/src/modules/m_connflood.cpp b/src/modules/m_connflood.cpp index c44c29074..fe3cd06ac 100644 --- a/src/modules/m_connflood.cpp +++ b/src/modules/m_connflood.cpp @@ -81,7 +81,7 @@ public: { /* expire throttle */ throttled = 0; - ServerInstance->WriteOpers("*** Connection throttle deactivated"); + ServerInstance->SNO->WriteToSnoMask('O', "Connection throttle deactivated"); return 0; } User::QuitUser(ServerInstance, user, quitmsg); @@ -93,7 +93,7 @@ public: if (conns >= maxconns) { throttled = 1; - ServerInstance->WriteOpers("*** Connection throttle activated"); + ServerInstance->SNO->WriteToSnoMask('O', "Connection throttle activated"); User::QuitUser(ServerInstance, user, quitmsg); return 1; } diff --git a/src/modules/m_customtitle.cpp b/src/modules/m_customtitle.cpp index 4cc2906f2..bd888d3f3 100644 --- a/src/modules/m_customtitle.cpp +++ b/src/modules/m_customtitle.cpp @@ -90,7 +90,7 @@ bool OneOfMatches(const char* host, const char* ip, const char* hostlist) if (!ServerInstance->ULine(user->server)) // Ulines set TITLEs silently - ServerInstance->WriteOpers("*** %s used TITLE to set custom title '%s'",user->nick,title.c_str()); + ServerInstance->SNO->WriteToSnoMask('O', "%s used TITLE to set custom title '%s'",user->nick,title.c_str()); user->WriteServ("NOTICE %s :Custom title set to '%s'",user->nick, title.c_str()); @@ -100,7 +100,7 @@ bool OneOfMatches(const char* host, const char* ip, const char* hostlist) if (!ServerInstance->ULine(user->server)) // Ulines also fail TITLEs silently - ServerInstance->WriteOpers("*** Failed TITLE attempt by %s!%s@%s using login '%s'",user->nick,user->ident,user->host,parameters[0]); + ServerInstance->SNO->WriteToSnoMask('O', "Failed TITLE attempt by %s!%s@%s using login '%s'",user->nick,user->ident,user->host,parameters[0]); user->WriteServ("NOTICE %s :Invalid title credentials",user->nick); return CMD_SUCCESS; diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp index 0a52a6817..b46317c59 100644 --- a/src/modules/m_dnsbl.cpp +++ b/src/modules/m_dnsbl.cpp @@ -156,7 +156,7 @@ class DNSBLResolver : public Resolver if (show) { - ServerInstance->WriteOpers("*** Connecting user %s detected as being on a DNS blacklist (%s) with result %d", them->GetFullRealHost(), ConfEntry->name.c_str(), bitmask); + ServerInstance->SNO->WriteToSnoMask('O', "Connecting user %s detected as being on a DNS blacklist (%s) with result %d", them->GetFullRealHost(), ConfEntry->name.c_str(), bitmask); } } else @@ -264,25 +264,25 @@ class ModuleDNSBL : public Module /* yeah, logic here is a little messy */ if (e->bitmask <= 0) { - ServerInstance->WriteOpers("*** DNSBL(#%d): invalid bitmask",i); + ServerInstance->SNO->WriteToSnoMask('O', "DNSBL(#%d): invalid bitmask",i); } else if (e->name.empty()) { - ServerInstance->WriteOpers("*** DNSBL(#%d): Invalid name",i); + ServerInstance->SNO->WriteToSnoMask('O', "DNSBL(#%d): Invalid name",i); } else if (e->domain.empty()) { - ServerInstance->WriteOpers("*** DNSBL(#%d): Invalid domain",i); + ServerInstance->SNO->WriteToSnoMask('O', "DNSBL(#%d): Invalid domain",i); } else if (e->banaction == DNSBLConfEntry::I_UNKNOWN) { - ServerInstance->WriteOpers("*** DNSBL(#%d): Invalid banaction", i); + ServerInstance->SNO->WriteToSnoMask('O', "DNSBL(#%d): Invalid banaction", i); } else { if (e->reason.empty()) { - ServerInstance->WriteOpers("*** DNSBL(#%d): empty reason, using defaults",i); + ServerInstance->SNO->WriteToSnoMask('O', "DNSBL(#%d): empty reason, using defaults",i); e->reason = "Your IP has been blacklisted."; } diff --git a/src/modules/m_filter.h b/src/modules/m_filter.h index 61c282b29..5313d5238 100644 --- a/src/modules/m_filter.h +++ b/src/modules/m_filter.h @@ -267,7 +267,7 @@ int FilterBase::OnUserPreNotice(User* user,void* dest,int target_type, std::stri } if (f->action == "block") { - ServerInstance->WriteOpers(std::string("FILTER: ")+user->nick+" had their message filtered, target was "+target+": "+f->reason); + ServerInstance->SNO->WriteToSnoMask('O', std::string("FILTER: ")+user->nick+" had their message filtered, target was "+target+": "+f->reason); user->WriteServ("NOTICE "+std::string(user->nick)+" :Your message has been filtered and opers notified: "+f->reason); } if (f->action == "silent") diff --git a/src/modules/m_globalload.cpp b/src/modules/m_globalload.cpp index 1859cf5cb..7f594b7c9 100644 --- a/src/modules/m_globalload.cpp +++ b/src/modules/m_globalload.cpp @@ -35,7 +35,7 @@ class CommandGloadmodule : public Command { if (ServerInstance->Modules->Load(parameters[0])) { - ServerInstance->WriteOpers("*** NEW MODULE '%s' GLOBALLY LOADED BY '%s'",parameters[0],user->nick); + ServerInstance->SNO->WriteToSnoMask('O', "NEW MODULE '%s' GLOBALLY LOADED BY '%s'",parameters[0],user->nick); user->WriteServ("975 %s %s :Module successfully loaded.",user->nick, parameters[0]); } else @@ -44,7 +44,7 @@ class CommandGloadmodule : public Command } } else - ServerInstance->WriteOpers("*** MODULE '%s' GLOBAL LOAD BY '%s' (not loaded here)",parameters[0],user->nick); + ServerInstance->SNO->WriteToSnoMask('O', "MODULE '%s' GLOBAL LOAD BY '%s' (not loaded here)",parameters[0],user->nick); return CMD_SUCCESS; } @@ -69,7 +69,7 @@ class CommandGunloadmodule : public Command { if (ServerInstance->Modules->Unload(parameters[0])) { - ServerInstance->WriteOpers("*** MODULE '%s' GLOBALLY UNLOADED BY '%s'",parameters[0],user->nick); + ServerInstance->SNO->WriteToSnoMask('O', "MODULE '%s' GLOBALLY UNLOADED BY '%s'",parameters[0],user->nick); user->WriteServ("973 %s %s :Module successfully unloaded.",user->nick, parameters[0]); } else @@ -78,7 +78,7 @@ class CommandGunloadmodule : public Command } } else - ServerInstance->WriteOpers("*** MODULE '%s' GLOBAL UNLOAD BY '%s' (not unloaded here)",parameters[0],user->nick); + ServerInstance->SNO->WriteToSnoMask('O', "MODULE '%s' GLOBAL UNLOAD BY '%s' (not unloaded here)",parameters[0],user->nick); return CMD_SUCCESS; } @@ -109,11 +109,11 @@ class CommandGreloadmodule : public Command { user->WriteServ("974 %s %s :%s",user->nick, parameters[0],ServerInstance->Modules->LastError().c_str()); } - ServerInstance->WriteOpers("*** MODULE '%s' GLOBALLY RELOADED BY '%s'",parameters[0],user->nick); + ServerInstance->SNO->WriteToSnoMask('O', "MODULE '%s' GLOBALLY RELOADED BY '%s'",parameters[0],user->nick); user->WriteServ("975 %s %s :Module successfully loaded.",user->nick, parameters[0]); } else - ServerInstance->WriteOpers("*** MODULE '%s' GLOBAL RELOAD BY '%s' (not reloaded here)",parameters[0],user->nick); + ServerInstance->SNO->WriteToSnoMask('O', "MODULE '%s' GLOBAL RELOAD BY '%s' (not reloaded here)",parameters[0],user->nick); return CMD_SUCCESS; } diff --git a/src/modules/m_invisible.cpp b/src/modules/m_invisible.cpp index 1cb4906aa..b3f30275d 100644 --- a/src/modules/m_invisible.cpp +++ b/src/modules/m_invisible.cpp @@ -115,7 +115,7 @@ class InvisibleMode : public ModeHandler } } - ServerInstance->WriteOpers("*** \2NOTICE\2: Oper %s has become %svisible (%sQ)", dest->GetFullHost(), adding ? "in" : "", adding ? "+" : "-"); + ServerInstance->SNO->WriteToSnoMask('O', "\2NOTICE\2: Oper %s has become %svisible (%sQ)", dest->GetFullHost(), adding ? "in" : "", adding ? "+" : "-"); } return MODEACTION_ALLOW; } @@ -193,7 +193,7 @@ class ModuleInvisible : public Module silent = true; /* Because we silenced the event, make sure it reaches the user whos joining (but only them of course) */ this->WriteCommonFrom(user, channel, "JOIN %s", channel->name); - ServerInstance->WriteOpers("*** \2NOTICE\2: Oper %s has joined %s invisibly (+Q)", user->GetFullHost(), channel->name); + ServerInstance->SNO->WriteToSnoMask('O', "\2NOTICE\2: Oper %s has joined %s invisibly (+Q)", user->GetFullHost(), channel->name); } } diff --git a/src/modules/m_lockserv.cpp b/src/modules/m_lockserv.cpp index d9cd3c67c..80b90f129 100644 --- a/src/modules/m_lockserv.cpp +++ b/src/modules/m_lockserv.cpp @@ -38,7 +38,7 @@ public: { locked = true; user->WriteServ("988 %s %s :Closed for new connections", user->nick, user->server); - ServerInstance->WriteOpers("*** Oper %s used LOCKSERV to temporarily close for new connections", user->nick); + ServerInstance->SNO->WriteToSnoMask('O', "Oper %s used LOCKSERV to temporarily close for new connections", user->nick); /* Dont send to the network */ return CMD_LOCALONLY; } @@ -61,7 +61,7 @@ public: { locked = false; user->WriteServ("989 %s %s :Open for new connections", user->nick, user->server); - ServerInstance->WriteOpers("*** Oper %s used UNLOCKSERV to allow for new connections", user->nick); + ServerInstance->SNO->WriteToSnoMask('O', "Oper %s used UNLOCKSERV to allow for new connections", user->nick); /* Dont send to the network */ return CMD_LOCALONLY; } diff --git a/src/modules/m_nicklock.cpp b/src/modules/m_nicklock.cpp index 9dc1bca69..56d2216fd 100644 --- a/src/modules/m_nicklock.cpp +++ b/src/modules/m_nicklock.cpp @@ -54,7 +54,7 @@ class CommandNicklock : public Command } // let others know - ServerInstance->WriteOpers(std::string(user->nick)+" used NICKLOCK to change and hold "+parameters[0]+" to "+parameters[1]); + ServerInstance->SNO->WriteToSnoMask('O', std::string(user->nick)+" used NICKLOCK to change and hold "+parameters[0]+" to "+parameters[1]); if (!source->ForceNickChange(parameters[1])) { @@ -88,7 +88,7 @@ class CommandNickunlock : public Command { source->Shrink("nick_locked"); user->WriteServ("945 %s %s :Nickname now unlocked.",user->nick,source->nick); - ServerInstance->WriteOpers(std::string(user->nick)+" used NICKUNLOCK on "+parameters[0]); + ServerInstance->SNO->WriteToSnoMask('O', std::string(user->nick)+" used NICKUNLOCK on "+parameters[0]); return CMD_SUCCESS; } diff --git a/src/modules/m_operlevels.cpp b/src/modules/m_operlevels.cpp index 654cb5c01..5e0bc6704 100644 --- a/src/modules/m_operlevels.cpp +++ b/src/modules/m_operlevels.cpp @@ -19,22 +19,15 @@ class ModuleOperLevels : public Module { - private: - - ConfigReader* conf; - public: - ModuleOperLevels(InspIRCd* Me) : Module(Me) { - - conf = new ConfigReader(ServerInstance); - Implementation eventlist[] = { I_OnRehash, I_OnKill }; - ServerInstance->Modules->Attach(eventlist, this, 2); + Implementation eventlist[] = { I_OnRehash, I_OnKill }; + ServerInstance->Modules->Attach(eventlist, this, 2); } virtual ~ModuleOperLevels() @@ -81,7 +74,7 @@ class ModuleOperLevels : public Module } if (dest_level > source_level) { - ServerInstance->WriteOpers("Oper %s (level %d) attempted to /kill a higher oper: %s (level %d): Reason: %s",source->nick,source_level,dest->nick,dest_level,reason.c_str()); + ServerInstance->SNO->WriteToSnoMask('O', "Oper %s (level %d) attempted to /kill a higher oper: %s (level %d): Reason: %s",source->nick,source_level,dest->nick,dest_level,reason.c_str()); dest->WriteServ("NOTICE %s :Oper %s attempted to /kill you!",dest->nick,source->nick); source->WriteServ("481 %s :Permission Denied - Oper %s is a higher level than you",source->nick,dest->nick); return 1; diff --git a/src/modules/m_sajoin.cpp b/src/modules/m_sajoin.cpp index 9a625ed06..6ea1c948e 100644 --- a/src/modules/m_sajoin.cpp +++ b/src/modules/m_sajoin.cpp @@ -57,7 +57,7 @@ class CommandSajoin : public Command { if (n->HasUser(dest)) { - ServerInstance->WriteOpers("*** "+std::string(user->nick)+" used SAJOIN to make "+std::string(dest->nick)+" join "+parameters[1]); + ServerInstance->SNO->WriteToSnoMask('O', std::string(user->nick)+" used SAJOIN to make "+std::string(dest->nick)+" join "+parameters[1]); return CMD_SUCCESS; } else @@ -74,7 +74,7 @@ class CommandSajoin : public Command } else { - ServerInstance->WriteOpers("*** "+std::string(user->nick)+" sent remote SAJOIN to make "+std::string(dest->nick)+" join "+parameters[1]); + ServerInstance->SNO->WriteToSnoMask('O', std::string(user->nick)+" sent remote SAJOIN to make "+std::string(dest->nick)+" join "+parameters[1]); return CMD_SUCCESS; } } diff --git a/src/modules/m_samode.cpp b/src/modules/m_samode.cpp index a907e2d90..fb379310f 100644 --- a/src/modules/m_samode.cpp +++ b/src/modules/m_samode.cpp @@ -35,7 +35,7 @@ class CommandSamode : public Command if (ServerInstance->Modes->GetLastParse().length()) { - ServerInstance->WriteOpers("*** " + std::string(user->nick) + " used SAMODE: " + ServerInstance->Modes->GetLastParse()); + ServerInstance->SNO->WriteToSnoMask('O', std::string(user->nick) + " used SAMODE: " + ServerInstance->Modes->GetLastParse()); std::deque<std::string> n; irc::spacesepstream spaced(ServerInstance->Modes->GetLastParse()); diff --git a/src/modules/m_sanick.cpp b/src/modules/m_sanick.cpp index c2989d390..62fd6ea8c 100644 --- a/src/modules/m_sanick.cpp +++ b/src/modules/m_sanick.cpp @@ -42,13 +42,13 @@ class CommandSanick : public Command { if (source->ForceNickChange(parameters[1])) { - ServerInstance->WriteOpers("*** " + oldnick+" used SANICK to change "+std::string(parameters[0])+" to "+parameters[1]); + ServerInstance->SNO->WriteToSnoMask('O', oldnick+" used SANICK to change "+std::string(parameters[0])+" to "+parameters[1]); return CMD_SUCCESS; } else { /* We couldnt change the nick */ - ServerInstance->WriteOpers("*** " + oldnick+" failed SANICK (from "+std::string(parameters[0])+" to "+parameters[1]+")"); + ServerInstance->SNO->WriteToSnoMask('O', oldnick+" failed SANICK (from "+std::string(parameters[0])+" to "+parameters[1]+")"); return CMD_FAILURE; } } diff --git a/src/modules/m_sapart.cpp b/src/modules/m_sapart.cpp index 0b6408da7..e59c8f9b4 100644 --- a/src/modules/m_sapart.cpp +++ b/src/modules/m_sapart.cpp @@ -58,14 +58,14 @@ class CommandSapart : public Command Channel* n = ServerInstance->FindChan(parameters[1]); if (!n) { - ServerInstance->WriteOpers("*** "+std::string(user->nick)+" used SAPART to make "+dest->nick+" part "+parameters[1]); + ServerInstance->SNO->WriteToSnoMask('O', std::string(user->nick)+" used SAPART to make "+dest->nick+" part "+parameters[1]); return CMD_SUCCESS; } else { if (!n->HasUser(dest)) { - ServerInstance->WriteOpers("*** "+std::string(user->nick)+" used SAPART to make "+dest->nick+" part "+parameters[1]); + ServerInstance->SNO->WriteToSnoMask('O', std::string(user->nick)+" used SAPART to make "+dest->nick+" part "+parameters[1]); return CMD_SUCCESS; } else @@ -77,7 +77,7 @@ class CommandSapart : public Command } else { - ServerInstance->WriteOpers("*** "+std::string(user->nick)+" sent remote SAPART to make "+dest->nick+" part "+parameters[1]); + ServerInstance->SNO->WriteToSnoMask('O', std::string(user->nick)+" sent remote SAPART to make "+dest->nick+" part "+parameters[1]); } return CMD_SUCCESS; diff --git a/src/modules/m_saquit.cpp b/src/modules/m_saquit.cpp index dbe8e85d3..14a534d17 100644 --- a/src/modules/m_saquit.cpp +++ b/src/modules/m_saquit.cpp @@ -40,7 +40,7 @@ class CommandSaquit : public Command irc::stringjoiner reason_join(" ", parameters, 1, pcnt - 1); std::string line = reason_join.GetJoined(); - ServerInstance->WriteOpers("*** "+std::string(user->nick)+" used SAQUIT to make "+std::string(dest->nick)+" quit with a reason of "+line); + ServerInstance->SNO->WriteToSnoMask('O', std::string(user->nick)+" used SAQUIT to make "+std::string(dest->nick)+" quit with a reason of "+line); // Pass the command on, so the client's server can quit it properly. if (!IS_LOCAL(dest)) diff --git a/src/modules/m_servprotect.cpp b/src/modules/m_servprotect.cpp index 99c6b9d95..0e7b8ce09 100644 --- a/src/modules/m_servprotect.cpp +++ b/src/modules/m_servprotect.cpp @@ -80,7 +80,7 @@ class ModuleServProtectMode : public Module if (dst->IsModeSet('k')) { src->WriteServ("485 %s :You are not allowed to kill %s Services!", src->nick, ServerInstance->Config->Network); - ServerInstance->WriteOpers("*** "+std::string(src->nick)+" tried to kill service "+dst->nick+" ("+reason+")"); + ServerInstance->SNO->WriteToSnoMask('O', std::string(src->nick)+" tried to kill service "+dst->nick+" ("+reason+")"); return 1; } return 0; diff --git a/src/modules/m_sethost.cpp b/src/modules/m_sethost.cpp index 402d47ffe..079c2bfd4 100644 --- a/src/modules/m_sethost.cpp +++ b/src/modules/m_sethost.cpp @@ -52,7 +52,7 @@ class CommandSethost : public Command } if (user->ChangeDisplayedHost(parameters[0])) { - ServerInstance->WriteOpers(std::string(user->nick)+" used SETHOST to change their displayed host to "+user->dhost); + ServerInstance->SNO->WriteToSnoMask('O', std::string(user->nick)+" used SETHOST to change their displayed host to "+user->dhost); return CMD_SUCCESS; } diff --git a/src/modules/m_setident.cpp b/src/modules/m_setident.cpp index 5d0d999f8..a0447f92a 100644 --- a/src/modules/m_setident.cpp +++ b/src/modules/m_setident.cpp @@ -48,7 +48,7 @@ class CommandSetident : public Command } user->ChangeIdent(parameters[0]); - ServerInstance->WriteOpers("%s used SETIDENT to change their ident to '%s'", user->nick, user->ident); + ServerInstance->SNO->WriteToSnoMask('O', "%s used SETIDENT to change their ident to '%s'", user->nick, user->ident); return CMD_SUCCESS; } diff --git a/src/modules/m_setidle.cpp b/src/modules/m_setidle.cpp index 10043c4e0..bdad8bf8b 100644 --- a/src/modules/m_setidle.cpp +++ b/src/modules/m_setidle.cpp @@ -39,7 +39,7 @@ class CommandSetidle : public Command // minor tweak - we cant have signon time shorter than our idle time! if (user->signon > user->idle_lastmsg) user->signon = user->idle_lastmsg; - ServerInstance->WriteOpers(std::string(user->nick)+" used SETIDLE to set their idle time to "+ConvToStr(idle)+" seconds"); + ServerInstance->SNO->WriteToSnoMask('O', std::string(user->nick)+" used SETIDLE to set their idle time to "+ConvToStr(idle)+" seconds"); user->WriteServ("944 %s :Idle time set.",user->nick); return CMD_LOCALONLY; diff --git a/src/modules/m_setname.cpp b/src/modules/m_setname.cpp index 83d3c379e..4bf1f17b2 100644 --- a/src/modules/m_setname.cpp +++ b/src/modules/m_setname.cpp @@ -43,7 +43,7 @@ class CommandSetname : public Command if (user->ChangeName(parameters[0])) { - ServerInstance->WriteOpers("%s used SETNAME to change their GECOS to %s", user->nick, parameters[0]); + ServerInstance->SNO->WriteToSnoMask('O', "%s used SETNAME to change their GECOS to %s", user->nick, parameters[0]); return CMD_SUCCESS; } diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index dabc20fdf..bc11cfe1e 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -732,7 +732,7 @@ void ModuleSpanningTree::OnRehash(User* user, const std::string ¶meter) // check for self if (ServerInstance->MatchText(ServerInstance->Config->ServerName,parameter)) { - ServerInstance->WriteOpers("*** Remote rehash initiated locally by \002%s\002", user ? user->nick : ServerInstance->Config->ServerName); + ServerInstance->SNO->WriteToSnoMask('O', "Remote rehash initiated locally by \002%s\002", user ? user->nick : ServerInstance->Config->ServerName); ServerInstance->RehashServer(); } } diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index e5d25dc50..9f69f0ca1 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -1462,7 +1462,7 @@ bool TreeSocket::ProcessLine(std::string &line) if (!this->InboundServerName.empty()) sourceserv = this->InboundServerName; if (params.size() >= 1) - Instance->WriteOpers("*** From " + prefix + ": " + params[0]); + Instance->SNO->WriteToSnoMask('O', "From " + prefix + ": " + params[0]); return Utils->DoOneToAllButSenderRaw(line, sourceserv, prefix, command, params); } else if (command == "MODENOTICE") diff --git a/src/modules/m_svshold.cpp b/src/modules/m_svshold.cpp index ac09beba8..0825a1a29 100644 --- a/src/modules/m_svshold.cpp +++ b/src/modules/m_svshold.cpp @@ -125,12 +125,12 @@ class CommandSvshold : public Command if(length > 0) { user->WriteServ( "385 %s %s :Added %lu second SVSHOLD (%s)", user->nick, parameters[0], length, reason.c_str()); - ServerInstance->WriteOpers("*** %s added %lu second SVSHOLD on %s (%s)", user->nick, length, parameters[0], reason.c_str()); + ServerInstance->SNO->WriteToSnoMask('O', "%s added %lu second SVSHOLD on %s (%s)", user->nick, length, parameters[0], reason.c_str()); } else { user->WriteServ( "385 %s %s :Added permanent SVSHOLD on %s (%s)", user->nick, parameters[0], parameters[0], reason.c_str()); - ServerInstance->WriteOpers("*** %s added permanent SVSHOLD on %s (%s)", user->nick, parameters[0], reason.c_str()); + ServerInstance->SNO->WriteToSnoMask('O', "%s added permanent SVSHOLD on %s (%s)", user->nick, parameters[0], reason.c_str()); } } else @@ -261,7 +261,7 @@ class ModuleSVSHold : public Module if ((*iter)->set_on + (*iter)->length <= ServerInstance->Time()) { ServerInstance->Log(DEBUG, "m_svshold.so: hold on %s expired, removing...", (*iter)->nickname.c_str()); - ServerInstance->WriteOpers("*** %li second SVSHOLD on %s (%s) set %u seconds ago expired", (*iter)->length, (*iter)->nickname.c_str(), (*iter)->reason.c_str(), ServerInstance->Time() - (*iter)->set_on); + ServerInstance->SNO->WriteToSnoMask('O',"%li second SVSHOLD on %s (%s) set %u seconds ago expired", (*iter)->length, (*iter)->nickname.c_str(), (*iter)->reason.c_str(), ServerInstance->Time() - (*iter)->set_on); HoldMap.erase(assign((*iter)->nickname)); delete *iter; safeiter = iter; diff --git a/src/modules/m_swhois.cpp b/src/modules/m_swhois.cpp index bf63ad1c4..93cf76023 100644 --- a/src/modules/m_swhois.cpp +++ b/src/modules/m_swhois.cpp @@ -62,7 +62,7 @@ class CommandSwhois : public Command 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()); + ServerInstance->SNO->WriteToSnoMask('O', "%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; @@ -70,7 +70,7 @@ class CommandSwhois : public Command 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()); + ServerInstance->SNO->WriteToSnoMask('O', "%s used SWHOIS to set %s's extra whois to '%s'", user->nick, dest->nick, line.c_str()); } text = new std::string(line); |