summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2009-01-02 15:59:02 +0000
committerpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2009-01-02 15:59:02 +0000
commitea5245d625c754afeb2be1fe20c8141d2fd665d6 (patch)
treed910ee57696ab30d4c63c7273e02b3d9bc07c2da
parent5ea30058979de9108ee03194c46b6615bebcc495 (diff)
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
-rw-r--r--conf/modules.conf.example5
-rw-r--r--src/modules/m_opermotd.cpp5
2 files changed, 8 insertions, 2 deletions
diff --git a/conf/modules.conf.example b/conf/modules.conf.example
index 7fb0b69a1..dc99a61ba 100644
--- a/conf/modules.conf.example
+++ b/conf/modules.conf.example
@@ -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
diff --git a/src/modules/m_opermotd.cpp b/src/modules/m_opermotd.cpp
index e64239950..aa927ad38 100644
--- a/src/modules/m_opermotd.cpp
+++ b/src/modules/m_opermotd.cpp
@@ -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)