Make it optional to show opermotd on /OPER, defaults to showing the motd if not specified.

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10930 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
peavey 2009-01-02 15:59:02 +00:00
parent 5ea3005897
commit ea5245d625
2 changed files with 8 additions and 2 deletions

View File

@ -1084,7 +1084,10 @@
# #
# If you are using the m_opermotd.so module, specify the motd here #
# #
#<opermotd file="oper.motd">
# onoper - Should the message be sent on /OPER or only when #
# /OPERMOTD is used. Use "yes" or "no". #
# #
#<opermotd file="oper.motd" onoper="yes">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# Override module: Adds support for oper override

View File

@ -59,6 +59,7 @@ class CommandOpermotd : public Command
class ModuleOpermotd : public Module
{
CommandOpermotd* mycommand;
bool onoper;
public:
void LoadOperMOTD()
@ -72,6 +73,7 @@ class ModuleOpermotd : public Module
opermotd = NULL;
}
opermotd = new FileReader(ServerInstance, filename);
onoper = conf->ReadFlag("opermoth","onoper","yes",0);
delete conf;
}
@ -99,7 +101,8 @@ class ModuleOpermotd : public Module
virtual void OnOper(User* user, const std::string &opertype)
{
ShowOperMOTD(user);
if (onoper)
ShowOperMOTD(user);
}
virtual void OnRehash(User* user, const std::string &parameter)