diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-02-25 19:42:08 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-02-25 19:42:08 +0000 |
commit | 61197974c5f7ce009096468b208c3abf2c25810b (patch) | |
tree | 9a7cf7a895941d1d734093a3bbc7f9c27f6e734c /src/modules | |
parent | 52a42b48cd63bd49991130f9cf7f2b0e13c76448 (diff) |
Make remote/local snomasks consistent and allow use without naming
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12568 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_chancreate.cpp | 7 | ||||
-rw-r--r-- | src/modules/m_globops.cpp | 16 | ||||
-rw-r--r-- | src/modules/m_override.cpp | 21 | ||||
-rw-r--r-- | src/modules/m_seenicks.cpp | 12 |
4 files changed, 15 insertions, 41 deletions
diff --git a/src/modules/m_chancreate.cpp b/src/modules/m_chancreate.cpp index 251829ff7..c4c28bc30 100644 --- a/src/modules/m_chancreate.cpp +++ b/src/modules/m_chancreate.cpp @@ -22,17 +22,10 @@ class ModuleChanCreate : public Module ModuleChanCreate() { ServerInstance->SNO->EnableSnomask('j', "CHANCREATE"); - ServerInstance->SNO->EnableSnomask('J', "REMOTECHANCREATE"); Implementation eventlist[] = { I_OnUserJoin }; ServerInstance->Modules->Attach(eventlist, this, 1); } - ~ModuleChanCreate() - { - ServerInstance->SNO->DisableSnomask('j'); - ServerInstance->SNO->DisableSnomask('J'); - } - Version GetVersion() { return Version("Creates a snomask with notices whenever a new channel is created",VF_VENDOR); diff --git a/src/modules/m_globops.cpp b/src/modules/m_globops.cpp index f02f8a1b2..16ce91926 100644 --- a/src/modules/m_globops.cpp +++ b/src/modules/m_globops.cpp @@ -35,8 +35,7 @@ class CommandGlobops : public Command { line = line + parameters[i] + " "; } - ServerInstance->SNO->WriteToSnoMask('g',line); - ServerInstance->PI->SendSNONotice("g", line); + ServerInstance->SNO->WriteGlobalSno('g',line); return CMD_SUCCESS; } @@ -46,22 +45,17 @@ class ModuleGlobops : public Module { CommandGlobops cmd; public: - ModuleGlobops() - : cmd(this) + ModuleGlobops() : cmd(this) {} + + void init() { ServerInstance->AddCommand(&cmd); ServerInstance->SNO->EnableSnomask('g',"GLOBOPS"); - - } - - virtual ~ModuleGlobops() - { - ServerInstance->SNO->DisableSnomask('g'); } virtual Version GetVersion() { - return Version("Provides support for GLOBOPS and user mode +g", VF_OPTCOMMON | VF_VENDOR); + return Version("Provides support for GLOBOPS and user mode +g", VF_VENDOR); } }; diff --git a/src/modules/m_override.cpp b/src/modules/m_override.cpp index c443a88d8..4e120ced1 100644 --- a/src/modules/m_override.cpp +++ b/src/modules/m_override.cpp @@ -26,7 +26,7 @@ class ModuleOverride : public Module { // read our config options (main config file) OnRehash(NULL); - ServerInstance->SNO->EnableSnomask('G', "GODMODE"); + ServerInstance->SNO->EnableSnomask('v', "OVERRIDE"); Implementation eventlist[] = { I_OnRehash, I_OnPreMode, I_On005Numeric, I_OnUserPreJoin, I_OnUserPreKick, I_OnPreTopicChange }; ServerInstance->Modules->Attach(eventlist, this, 6); } @@ -61,7 +61,7 @@ class ModuleOverride : public Module { if (!channel->HasUser(source) || (channel->IsModeSet('t') && channel->GetPrefixValue(source) < HALFOP_VALUE)) { - ServerInstance->SNO->WriteGlobalSno('G',std::string(source->nick)+" used oper override to change a topic on "+std::string(channel->name)); + ServerInstance->SNO->WriteGlobalSno('v',std::string(source->nick)+" used oper override to change a topic on "+std::string(channel->name)); } // Explicit allow @@ -78,7 +78,7 @@ class ModuleOverride : public Module // If the kicker's status is less than the target's, or the kicker's status is less than or equal to voice if ((memb->chan->GetPrefixValue(source) < memb->getRank()) || (memb->chan->GetPrefixValue(source) <= VOICE_VALUE)) { - ServerInstance->SNO->WriteGlobalSno('G',std::string(source->nick)+" used oper override to kick "+std::string(memb->user->nick)+" on "+std::string(memb->chan->name)+" ("+reason+")"); + ServerInstance->SNO->WriteGlobalSno('v',std::string(source->nick)+" used oper override to kick "+std::string(memb->user->nick)+" on "+std::string(memb->chan->name)+" ("+reason+")"); return MOD_RES_ALLOW; } } @@ -99,7 +99,7 @@ class ModuleOverride : public Module std::string msg = std::string(source->nick)+" overriding modes:"; for(unsigned int i=0; i < parameters.size(); i++) msg += " " + parameters[i]; - ServerInstance->SNO->WriteGlobalSno('G',msg); + ServerInstance->SNO->WriteGlobalSno('v',msg); return MOD_RES_ALLOW; } return MOD_RES_PASSTHRU; @@ -125,7 +125,7 @@ class ModuleOverride : public Module if (NoisyOverride) chan->WriteChannelWithServ(ServerInstance->Config->ServerName.c_str(), "NOTICE %s :%s used oper override to bypass invite-only", cname, user->nick.c_str()); - ServerInstance->SNO->WriteGlobalSno('G', user->nick+" used oper override to bypass +i on "+std::string(cname)); + ServerInstance->SNO->WriteGlobalSno('v', user->nick+" used oper override to bypass +i on "+std::string(cname)); } return MOD_RES_ALLOW; } @@ -141,7 +141,7 @@ class ModuleOverride : public Module if (NoisyOverride) chan->WriteChannelWithServ(ServerInstance->Config->ServerName.c_str(), "NOTICE %s :%s used oper override to bypass the channel key", cname, user->nick.c_str()); - ServerInstance->SNO->WriteGlobalSno('G', user->nick+" used oper override to bypass +k on "+std::string(cname)); + ServerInstance->SNO->WriteGlobalSno('v', user->nick+" used oper override to bypass +k on "+std::string(cname)); return MOD_RES_ALLOW; } @@ -156,7 +156,7 @@ class ModuleOverride : public Module if (NoisyOverride) chan->WriteChannelWithServ(ServerInstance->Config->ServerName.c_str(), "NOTICE %s :%s used oper override to bypass the channel limit", cname, user->nick.c_str()); - ServerInstance->SNO->WriteGlobalSno('G', user->nick+" used oper override to bypass +l on "+std::string(cname)); + ServerInstance->SNO->WriteGlobalSno('v', user->nick+" used oper override to bypass +l on "+std::string(cname)); return MOD_RES_ALLOW; } @@ -171,7 +171,7 @@ class ModuleOverride : public Module if (NoisyOverride) chan->WriteChannelWithServ(ServerInstance->Config->ServerName.c_str(), "NOTICE %s :%s used oper override to bypass channel ban", cname, user->nick.c_str()); - ServerInstance->SNO->WriteGlobalSno('G',"%s used oper override to bypass channel ban on %s", user->nick.c_str(), cname); + ServerInstance->SNO->WriteGlobalSno('v',"%s used oper override to bypass channel ban on %s", user->nick.c_str(), cname); return MOD_RES_ALLOW; } } @@ -179,11 +179,6 @@ class ModuleOverride : public Module return MOD_RES_PASSTHRU; } - ~ModuleOverride() - { - ServerInstance->SNO->DisableSnomask('G'); - } - Version GetVersion() { return Version("Provides support for unreal-style oper-override",VF_VENDOR); diff --git a/src/modules/m_seenicks.cpp b/src/modules/m_seenicks.cpp index 006329f53..f1d55297e 100644 --- a/src/modules/m_seenicks.cpp +++ b/src/modules/m_seenicks.cpp @@ -18,26 +18,18 @@ class ModuleSeeNicks : public Module { public: - ModuleSeeNicks() - { + void init() + { ServerInstance->SNO->EnableSnomask('n',"NICK"); - ServerInstance->SNO->EnableSnomask('N',"REMOTENICK"); Implementation eventlist[] = { I_OnUserPostNick }; ServerInstance->Modules->Attach(eventlist, this, 1); } - virtual ~ModuleSeeNicks() - { - ServerInstance->SNO->DisableSnomask('n'); - ServerInstance->SNO->DisableSnomask('N'); - } - virtual Version GetVersion() { return Version("Provides support for seeing local and remote nickchanges via snomasks", VF_VENDOR); } - virtual void OnUserPostNick(User* user, const std::string &oldnick) { ServerInstance->SNO->WriteToSnoMask(IS_LOCAL(user) ? 'n' : 'N',"User %s changed their nickname to %s", oldnick.c_str(), user->nick.c_str()); |