mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 02:59:01 -04:00
Convert cmd_modenotice into an optional module
This commit is contained in:
parent
16398df07d
commit
1f6ba902a6
@ -1058,6 +1058,11 @@
|
||||
# would likely be immediately bounced by services.
|
||||
#<module name="m_mlock.so">
|
||||
|
||||
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
|
||||
# Modenotice module: Adds the /MODENOTICE command that allows opers to
|
||||
# send notices to all users having the given user mode(s) set.
|
||||
#<module name="m_modenotice.so">
|
||||
|
||||
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
|
||||
# MsSQL module: Allows other SQL modules to access MS SQL Server
|
||||
# through a unified API.
|
||||
|
@ -48,8 +48,24 @@ next_user: ;
|
||||
|
||||
RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
|
||||
{
|
||||
return ROUTE_BROADCAST;
|
||||
return ROUTE_OPT_BCAST;
|
||||
}
|
||||
};
|
||||
|
||||
COMMAND_INIT(CommandModeNotice)
|
||||
class ModuleModeNotice : public Module
|
||||
{
|
||||
CommandModeNotice cmd;
|
||||
|
||||
public:
|
||||
ModuleModeNotice()
|
||||
: cmd(this)
|
||||
{
|
||||
}
|
||||
|
||||
Version GetVersion() CXX11_OVERRIDE
|
||||
{
|
||||
return Version("Provides the /MODENOTICE command", VF_VENDOR);
|
||||
}
|
||||
};
|
||||
|
||||
MODULE_INIT(ModuleModeNotice)
|
@ -286,6 +286,13 @@ bool TreeSocket::PreProcessOldProtocolMessage(User*& who, std::string& cmd, std:
|
||||
|
||||
params.insert(params.begin()+2, ConvToStr(ServerInstance->Time()));
|
||||
}
|
||||
else if (cmd == "MODENOTICE")
|
||||
{
|
||||
// MODENOTICE is always supported by 2.0 but it's optional in 2.2.
|
||||
params.insert(params.begin(), "*");
|
||||
params.insert(params.begin()+1, cmd);
|
||||
cmd = "ENCAP";
|
||||
}
|
||||
|
||||
return true; // Passthru
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user