summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/modules.h6
-rw-r--r--src/cmd_rehash.cpp2
-rw-r--r--src/inspircd.cpp2
-rw-r--r--src/modules.cpp2
-rw-r--r--src/modules/extra/m_filter_pcre.cpp4
-rw-r--r--src/modules/extra/m_mysql.cpp2
-rw-r--r--src/modules/extra/m_pgsql.cpp2
-rw-r--r--src/modules/extra/m_sqlauth.cpp4
-rw-r--r--src/modules/extra/m_sqllog.cpp4
-rw-r--r--src/modules/extra/m_sqloper.cpp4
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp4
-rw-r--r--src/modules/extra/m_ssl_openssl.cpp4
-rw-r--r--src/modules/m_alias.cpp2
-rw-r--r--src/modules/m_banexception.cpp2
-rw-r--r--src/modules/m_blockamsg.cpp4
-rw-r--r--src/modules/m_blockcaps.cpp4
-rw-r--r--src/modules/m_censor.cpp4
-rw-r--r--src/modules/m_cgiirc.cpp4
-rw-r--r--src/modules/m_chanfilter.cpp2
-rw-r--r--src/modules/m_chanprotect.cpp4
-rw-r--r--src/modules/m_chghost.cpp4
-rw-r--r--src/modules/m_cloaking.cpp4
-rw-r--r--src/modules/m_conn_umodes.cpp2
-rw-r--r--src/modules/m_conn_waitpong.cpp5
-rw-r--r--src/modules/m_connflood.cpp2
-rw-r--r--src/modules/m_dccallow.cpp2
-rw-r--r--src/modules/m_denychans.cpp4
-rw-r--r--src/modules/m_dnsbl.cpp2
-rw-r--r--src/modules/m_filter.cpp4
-rw-r--r--src/modules/m_filter.h4
-rw-r--r--src/modules/m_helpop.cpp12
-rw-r--r--src/modules/m_hostchange.cpp5
-rw-r--r--src/modules/m_ident.cpp2
-rw-r--r--src/modules/m_inviteexception.cpp2
-rw-r--r--src/modules/m_lockserv.cpp2
-rw-r--r--src/modules/m_oper_hash.cpp4
-rw-r--r--src/modules/m_operjoin.cpp2
-rw-r--r--src/modules/m_operlevels.cpp2
-rw-r--r--src/modules/m_opermodes.cpp2
-rw-r--r--src/modules/m_opermotd.cpp2
-rw-r--r--src/modules/m_override.cpp4
-rw-r--r--src/modules/m_remove.cpp4
-rw-r--r--src/modules/m_restrictchans.cpp2
-rw-r--r--src/modules/m_sethost.cpp4
-rw-r--r--src/modules/m_spanningtree.cpp8
-rw-r--r--src/modules/m_swhois.cpp2
-rw-r--r--src/modules/m_vhost.cpp2
47 files changed, 80 insertions, 80 deletions
diff --git a/include/modules.h b/include/modules.h
index 9928ad326..8c4b55a95 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -75,7 +75,7 @@ enum MessageType {
* ipv4 servers, so this value will be ten times as
* high on ipv6 servers.
*/
-#define NATIVE_API_VERSION 11009
+#define NATIVE_API_VERSION 11010
#ifdef IPV6
#define API_VERSION (NATIVE_API_VERSION * 10)
#else
@@ -518,9 +518,11 @@ class Module : public Extensible
* system. You should use it to reload any files so that your module keeps in step with the
* rest of the application. If a parameter is given, the core has done nothing. The module
* receiving the event can decide if this parameter has any relevence to it.
+ * @param user The user performing the rehash, if any -- if this is server initiated, the
+ * value of this variable will be NULL.
* @param parameter The (optional) parameter given to REHASH from the user.
*/
- virtual void OnRehash(const std::string &parameter);
+ virtual void OnRehash(userrec* user, const std::string &parameter);
/** Called when a raw command is transmitted or received.
* This method is the lowest level of handler available to a module. It will be called with raw
diff --git a/src/cmd_rehash.cpp b/src/cmd_rehash.cpp
index 579c04300..8154c5b92 100644
--- a/src/cmd_rehash.cpp
+++ b/src/cmd_rehash.cpp
@@ -45,7 +45,7 @@ CmdResult cmd_rehash::Handle (const char** parameters, int pcnt, userrec *user)
if (old_disabled != ServerInstance->Config->DisabledCommands)
InitializeDisabledCommands(ServerInstance->Config->DisabledCommands, ServerInstance);
- FOREACH_MOD(I_OnRehash,OnRehash(parameter));
+ FOREACH_MOD(I_OnRehash,OnRehash(user, parameter));
return CMD_SUCCESS;
}
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 9905a78d0..1509553ce 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -144,7 +144,7 @@ void InspIRCd::Rehash(int status)
FOREACH_MOD_I(SI, I_OnGarbageCollect, OnGarbageCollect());
SI->Config->Read(false,NULL);
SI->Res->Rehash();
- FOREACH_MOD_I(SI,I_OnRehash,OnRehash(""));
+ FOREACH_MOD_I(SI,I_OnRehash,OnRehash(NULL,""));
}
/** Because hash_map doesnt free its buckets when we delete items (this is a 'feature')
diff --git a/src/modules.cpp b/src/modules.cpp
index a67ebc6da..959092641 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -109,7 +109,7 @@ void Module::OnUserDisconnect(userrec* user) { }
void Module::OnUserJoin(userrec* user, chanrec* channel) { }
void Module::OnPostJoin(userrec* user, chanrec* channel) { }
void Module::OnUserPart(userrec* user, chanrec* channel, const std::string &partmessage) { }
-void Module::OnRehash(const std::string &parameter) { }
+void Module::OnRehash(userrec* user, const std::string &parameter) { }
void Module::OnServerRaw(std::string &raw, bool inbound, userrec* user) { }
int Module::OnUserPreJoin(userrec* user, chanrec* chan, const char* cname, std::string &privs) { return 0; }
void Module::OnMode(userrec* user, void* dest, int target_type, const std::string &text) { };
diff --git a/src/modules/extra/m_filter_pcre.cpp b/src/modules/extra/m_filter_pcre.cpp
index c82207131..6d4964913 100644
--- a/src/modules/extra/m_filter_pcre.cpp
+++ b/src/modules/extra/m_filter_pcre.cpp
@@ -47,7 +47,7 @@ class ModuleFilterPCRE : public FilterBase
ModuleFilterPCRE(InspIRCd* Me)
: FilterBase::FilterBase(Me, "m_filter_pcre.so")
{
- OnRehash("");
+ OnRehash(NULL,"");
}
virtual ~ModuleFilterPCRE()
@@ -115,7 +115,7 @@ class ModuleFilterPCRE : public FilterBase
}
}
- virtual void OnRehash(const std::string &parameter)
+ virtual void OnRehash(userrec* user, const std::string &parameter)
{
ConfigReader MyConf(ServerInstance);
diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp
index cebacde27..dd298bd1a 100644
--- a/src/modules/extra/m_mysql.cpp
+++ b/src/modules/extra/m_mysql.cpp
@@ -826,7 +826,7 @@ class ModuleSQL : public Module
return NULL;
}
- virtual void OnRehash(const std::string &parameter)
+ virtual void OnRehash(userrec* user, const std::string &parameter)
{
/* TODO: set rehash bool here, which makes the dispatcher thread rehash at next opportunity */
}
diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp
index d688149b8..fb2cb2966 100644
--- a/src/modules/extra/m_pgsql.cpp
+++ b/src/modules/extra/m_pgsql.cpp
@@ -1079,7 +1079,7 @@ public:
List[I_OnUnloadModule] = List[I_OnRequest] = List[I_OnRehash] = List[I_OnUserRegister] = List[I_OnCheckReady] = List[I_OnUserDisconnect] = 1;
}
- virtual void OnRehash(const std::string &parameter)
+ virtual void OnRehash(userrec* user, const std::string &parameter)
{
ReadConf();
}
diff --git a/src/modules/extra/m_sqlauth.cpp b/src/modules/extra/m_sqlauth.cpp
index b2b7c9044..7130439e0 100644
--- a/src/modules/extra/m_sqlauth.cpp
+++ b/src/modules/extra/m_sqlauth.cpp
@@ -50,7 +50,7 @@ public:
if (!SQLutils)
throw ModuleException("Can't find m_sqlutils.so. Please load m_sqlutils.so before m_sqlauth.so.");
- OnRehash("");
+ OnRehash(NULL,"");
}
virtual ~ModuleSQLAuth()
@@ -64,7 +64,7 @@ public:
List[I_OnUserDisconnect] = List[I_OnCheckReady] = List[I_OnRequest] = List[I_OnRehash] = List[I_OnUserRegister] = 1;
}
- virtual void OnRehash(const std::string &parameter)
+ virtual void OnRehash(userrec* user, const std::string &parameter)
{
ConfigReader Conf(Srv);
diff --git a/src/modules/extra/m_sqllog.cpp b/src/modules/extra/m_sqllog.cpp
index 401db811c..78c2164aa 100644
--- a/src/modules/extra/m_sqllog.cpp
+++ b/src/modules/extra/m_sqllog.cpp
@@ -194,7 +194,7 @@ class ModuleSQLLog : public Module
SQLModule = Srv->FindFeature("SQL");
- OnRehash("");
+ OnRehash(NULL,"");
MyMod = this;
active_queries.clear();
}
@@ -218,7 +218,7 @@ class ModuleSQLLog : public Module
dbid = Conf.ReadValue("sqllog","dbid",0); // database id of a database configured in sql module
}
- virtual void OnRehash(const std::string &parameter)
+ virtual void OnRehash(userrec* user, const std::string &parameter)
{
ReadConfig();
}
diff --git a/src/modules/extra/m_sqloper.cpp b/src/modules/extra/m_sqloper.cpp
index b7a45af45..ead9a4f36 100644
--- a/src/modules/extra/m_sqloper.cpp
+++ b/src/modules/extra/m_sqloper.cpp
@@ -42,7 +42,7 @@ public:
if (!SQLutils)
throw ModuleException("Can't find m_sqlutils.so. Please load m_sqlutils.so before m_sqloper.so.");
- OnRehash("");
+ OnRehash(NULL,"");
}
virtual ~ModuleSQLOper()
@@ -56,7 +56,7 @@ public:
List[I_OnRequest] = List[I_OnRehash] = List[I_OnPreCommand] = 1;
}
- virtual void OnRehash(const std::string &parameter)
+ virtual void OnRehash(userrec* user, const std::string &parameter)
{
ConfigReader Conf(Srv);
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp
index fbd809742..9eec655f7 100644
--- a/src/modules/extra/m_ssl_gnutls.cpp
+++ b/src/modules/extra/m_ssl_gnutls.cpp
@@ -106,13 +106,13 @@ class ModuleSSLGnuTLS : public Module
ServerInstance->Log(DEFAULT, "m_ssl_gnutls.so: Failed to initialise DH parameters");
// Needs the flag as it ignores a plain /rehash
- OnRehash("ssl");
+ OnRehash(NULL,"ssl");
// Void return, guess we assume success
gnutls_certificate_set_dh_params(x509_cred, dh_params);
}
- virtual void OnRehash(const std::string &param)
+ virtual void OnRehash(userrec* user, const std::string &param)
{
if(param != "ssl")
return;
diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp
index ca690fb8f..7ad78e2ea 100644
--- a/src/modules/extra/m_ssl_openssl.cpp
+++ b/src/modules/extra/m_ssl_openssl.cpp
@@ -133,10 +133,10 @@ class ModuleSSLOpenSSL : public Module
SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER | SSL_VERIFY_CLIENT_ONCE, OnVerify);
// Needs the flag as it ignores a plain /rehash
- OnRehash("ssl");
+ OnRehash(NULL,"ssl");
}
- virtual void OnRehash(const std::string &param)
+ virtual void OnRehash(userrec* user, const std::string &param)
{
if (param != "ssl")
return;
diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp
index 4e32f2856..e8e7cec1a 100644
--- a/src/modules/m_alias.cpp
+++ b/src/modules/m_alias.cpp
@@ -270,7 +270,7 @@ class ModuleAlias : public Module
}
}
- virtual void OnRehash(const std::string &parameter)
+ virtual void OnRehash(userrec* user, const std::string &parameter)
{
ReadAliases();
}
diff --git a/src/modules/m_banexception.cpp b/src/modules/m_banexception.cpp
index bc0d7f009..2d350e938 100644
--- a/src/modules/m_banexception.cpp
+++ b/src/modules/m_banexception.cpp
@@ -108,7 +108,7 @@ public:
be->DoChannelDelete(chan);
}
- virtual void OnRehash(const std::string &param)
+ virtual void OnRehash(userrec* user, const std::string &param)
{
be->DoRehash();
}
diff --git a/src/modules/m_blockamsg.cpp b/src/modules/m_blockamsg.cpp
index cfc662aee..39e3c16b1 100644
--- a/src/modules/m_blockamsg.cpp
+++ b/src/modules/m_blockamsg.cpp
@@ -48,7 +48,7 @@ public:
ModuleBlockAmsg(InspIRCd* Me) : Module::Module(Me)
{
- this->OnRehash("");
+ this->OnRehash(NULL,"");
}
void Implements(char* List)
@@ -65,7 +65,7 @@ public:
return Version(1,1,0,0,VF_VENDOR,API_VERSION);
}
- virtual void OnRehash(const std::string &parameter)
+ virtual void OnRehash(userrec* user, const std::string &parameter)
{
ConfigReader* Conf = new ConfigReader(ServerInstance);
diff --git a/src/modules/m_blockcaps.cpp b/src/modules/m_blockcaps.cpp
index b67c496f4..058336fb3 100644
--- a/src/modules/m_blockcaps.cpp
+++ b/src/modules/m_blockcaps.cpp
@@ -59,7 +59,7 @@ public:
ModuleBlockCAPS(InspIRCd* Me) : Module::Module(Me)
{
- OnRehash("");
+ OnRehash(NULL,"");
bc = new BlockCaps(ServerInstance);
if (!ServerInstance->AddMode(bc, 'P'))
throw ModuleException("Could not add new modes!");
@@ -70,7 +70,7 @@ public:
List[I_OnUserPreMessage] = List[I_OnUserPreNotice] = List[I_OnRehash] = 1;
}
- virtual void OnRehash(const std::string &param)
+ virtual void OnRehash(userrec* user, const std::string &param)
{
ReadConf();
}
diff --git a/src/modules/m_censor.cpp b/src/modules/m_censor.cpp
index 4df2db95e..0930c1d45 100644
--- a/src/modules/m_censor.cpp
+++ b/src/modules/m_censor.cpp
@@ -96,7 +96,7 @@ class ModuleCensor : public Module
{
/* Read the configuration file on startup.
*/
- OnRehash("");
+ OnRehash(NULL,"");
cu = new CensorUser(ServerInstance);
cc = new CensorChannel(ServerInstance);
if (!ServerInstance->AddMode(cu, 'G') || !ServerInstance->AddMode(cc, 'G'))
@@ -159,7 +159,7 @@ class ModuleCensor : public Module
return OnUserPreMessage(user,dest,target_type,text,status,exempt_list);
}
- virtual void OnRehash(const std::string &parameter)
+ virtual void OnRehash(userrec* user, const std::string &parameter)
{
/*
* reload our config file on rehash - we must destroy and re-allocate the classes
diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp
index 3124c5205..93593ed23 100644
--- a/src/modules/m_cgiirc.cpp
+++ b/src/modules/m_cgiirc.cpp
@@ -91,7 +91,7 @@ public:
ModuleCgiIRC(InspIRCd* Me) : Module::Module(Me)
{
- OnRehash("");
+ OnRehash(NULL,"");
}
void Implements(char* List)
@@ -105,7 +105,7 @@ public:
return PRIORITY_FIRST;
}
- virtual void OnRehash(const std::string &parameter)
+ virtual void OnRehash(userrec* user, const std::string &parameter)
{
ConfigReader Conf(ServerInstance);
diff --git a/src/modules/m_chanfilter.cpp b/src/modules/m_chanfilter.cpp
index de1f38a88..7c888c057 100644
--- a/src/modules/m_chanfilter.cpp
+++ b/src/modules/m_chanfilter.cpp
@@ -85,7 +85,7 @@ class ModuleChanFilter : public Module
cf->DoChannelDelete(chan);
}
- virtual void OnRehash(const std::string &parameter)
+ virtual void OnRehash(userrec* user, const std::string &parameter)
{
cf->DoRehash();
}
diff --git a/src/modules/m_chanprotect.cpp b/src/modules/m_chanprotect.cpp
index cab686372..f7c05572f 100644
--- a/src/modules/m_chanprotect.cpp
+++ b/src/modules/m_chanprotect.cpp
@@ -290,7 +290,7 @@ class ModuleChanProtect : public Module
: Module::Module(Me), FirstInGetsFounder(false), QAPrefixes(false), DeprivSelf(false), booting(true)
{
/* Load config stuff */
- OnRehash("");
+ OnRehash(NULL,"");
booting = false;
/* Initialise module variables */
@@ -321,7 +321,7 @@ class ModuleChanProtect : public Module
user->Shrink("cm_protect_"+std::string(channel->name));
}
- virtual void OnRehash(const std::string &parameter)
+ virtual void OnRehash(userrec* user, const std::string &parameter)
{
/* Create a configreader class and read our flag,
* in old versions this was heap-allocated and the
diff --git a/src/modules/m_chghost.cpp b/src/modules/m_chghost.cpp
index e0f69faba..3d4d29f74 100644
--- a/src/modules/m_chghost.cpp
+++ b/src/modules/m_chghost.cpp
@@ -75,7 +75,7 @@ class ModuleChgHost : public Module
ModuleChgHost(InspIRCd* Me)
: Module::Module(Me)
{
- OnRehash("");
+ OnRehash(NULL,"");
mycommand = new cmd_chghost(ServerInstance, hostmap);
ServerInstance->AddCommand(mycommand);
}
@@ -85,7 +85,7 @@ class ModuleChgHost : public Module
List[I_OnRehash] = 1;
}
- void OnRehash(const std::string &parameter)
+ void OnRehash(userrec* user, const std::string &parameter)
{
ConfigReader Conf(ServerInstance);
std::string hmap = Conf.ReadValue("hostname", "charmap", 0);
diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp
index 17e8c3405..707085b14 100644
--- a/src/modules/m_cloaking.cpp
+++ b/src/modules/m_cloaking.cpp
@@ -241,7 +241,7 @@ class ModuleCloaking : public Module
if (!ServerInstance->AddMode(cu, 'x'))
throw ModuleException("Could not add new modes!");
- OnRehash("");
+ OnRehash(NULL,"");
}
virtual ~ModuleCloaking()
@@ -258,7 +258,7 @@ class ModuleCloaking : public Module
return Version(1,1,0,2,VF_COMMON|VF_VENDOR,API_VERSION);
}
- virtual void OnRehash(const std::string &parameter)
+ virtual void OnRehash(userrec* user, const std::string &parameter)
{
cu->DoRehash();
}
diff --git a/src/modules/m_conn_umodes.cpp b/src/modules/m_conn_umodes.cpp
index 34e1a8733..1b6bbe66d 100644
--- a/src/modules/m_conn_umodes.cpp
+++ b/src/modules/m_conn_umodes.cpp
@@ -40,7 +40,7 @@ class ModuleModesOnConnect : public Module
List[I_OnPostConnect] = List[I_OnRehash] = 1;
}
- virtual void OnRehash(const std::string &parameter)
+ virtual void OnRehash(userrec* user, const std::string &parameter)
{
DELETE(Conf);
Conf = new ConfigReader(ServerInstance);
diff --git a/src/modules/m_conn_waitpong.cpp b/src/modules/m_conn_waitpong.cpp
index 531a1ce88..2bb1b107a 100644
--- a/src/modules/m_conn_waitpong.cpp
+++ b/src/modules/m_conn_waitpong.cpp
@@ -45,11 +45,10 @@ class ModuleWaitPong : public Module
ModuleWaitPong(InspIRCd* Me)
: Module::Module(Me)
{
-
- OnRehash("");
+ OnRehash(NULL,"");
}
- virtual void OnRehash(const std::string &param)
+ virtual void OnRehash(userrec* user, const std::string &param)
{
Conf = new ConfigReader(ServerInstance);
diff --git a/src/modules/m_connflood.cpp b/src/modules/m_connflood.cpp
index 519088324..40d64520f 100644
--- a/src/modules/m_connflood.cpp
+++ b/src/modules/m_connflood.cpp
@@ -110,7 +110,7 @@ public:
return 0;
}
- virtual void OnRehash(const std::string &parameter)
+ virtual void OnRehash(userrec* user, const std::string &parameter)
{
InitConf();
}
diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp
index e662995ae..c8459a705 100644
--- a/src/modules/m_dccallow.cpp
+++ b/src/modules/m_dccallow.cpp
@@ -267,7 +267,7 @@ class ModuleDCCAllow : public Module
List[I_OnUserPreMessage] = List[I_OnUserPreNotice] = List[I_OnUserQuit] = List[I_OnUserPreNick] = List[I_OnRehash] = 1;
}
- virtual void OnRehash(const std::string &parameter)
+ virtual void OnRehash(userrec* user, const std::string &parameter)
{
delete Conf;
Conf = new ConfigReader(ServerInstance);
diff --git a/src/modules/m_denychans.cpp b/src/modules/m_denychans.cpp
index f7af72486..cbd736869 100644
--- a/src/modules/m_denychans.cpp
+++ b/src/modules/m_denychans.cpp
@@ -34,12 +34,12 @@ class ModuleDenyChannels : public Module
Conf = new ConfigReader(ServerInstance);
}
- virtual void OnRehash(const std::string &param)
+ virtual void OnRehash(userrec* user, const std::string &param)
{
DELETE(Conf);
Conf = new ConfigReader(ServerInstance);
}
-
+
virtual ~ModuleDenyChannels()
{
DELETE(Conf);
diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp
index 03b691ece..4b4a36309 100644
--- a/src/modules/m_dnsbl.cpp
+++ b/src/modules/m_dnsbl.cpp
@@ -266,7 +266,7 @@ class ModuleDNSBL : public Module
delete MyConf;
}
- virtual void OnRehash(const std::string &parameter)
+ virtual void OnRehash(userrec* user, const std::string &parameter)
{
ReadConf();
}
diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp
index 79e98d295..a9ea3ba5e 100644
--- a/src/modules/m_filter.cpp
+++ b/src/modules/m_filter.cpp
@@ -33,7 +33,7 @@ class ModuleFilter : public FilterBase
ModuleFilter(InspIRCd* Me)
: FilterBase::FilterBase(Me, "m_filter.so")
{
- OnRehash("");
+ OnRehash(NULL,"");
}
virtual ~ModuleFilter()
@@ -89,7 +89,7 @@ class ModuleFilter : public FilterBase
}
}
- virtual void OnRehash(const std::string &parameter)
+ virtual void OnRehash(userrec* user, const std::string &parameter)
{
ConfigReader* MyConf = new ConfigReader(ServerInstance);
diff --git a/src/modules/m_filter.h b/src/modules/m_filter.h
index d21c8fc9c..282592776 100644
--- a/src/modules/m_filter.h
+++ b/src/modules/m_filter.h
@@ -50,7 +50,7 @@ class FilterBase : public Module
virtual void SendFilter(Module* proto, void* opaque, FilterResult* iter);
virtual std::pair<bool, std::string> AddFilter(const std::string &freeform, const std::string &type, const std::string &reason, long duration) = 0;
virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list);
- virtual void OnRehash(const std::string &parameter);
+ virtual void OnRehash(userrec* user, const std::string &parameter);
virtual Version GetVersion();
std::string EncodeFilter(FilterResult* filter);
FilterResult DecodeFilter(const std::string &data);
@@ -298,7 +298,7 @@ int FilterBase::OnPreCommand(const std::string &command, const char** parameters
return 0;
}
-void FilterBase::OnRehash(const std::string &parameter)
+void FilterBase::OnRehash(userrec* user, const std::string &parameter)
{
}
diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp
index 510e4e899..4d39f942b 100644
--- a/src/modules/m_helpop.cpp
+++ b/src/modules/m_helpop.cpp
@@ -55,11 +55,11 @@ class Helpop : public ModeHandler
class cmd_helpop : public command_t
{
public:
- cmd_helpop (InspIRCd* Instance) : command_t(Instance, "HELPOP", 0, 1)
- {
- this->source = "m_helpop.so";
- syntax = "<any-text>";
- }
+ cmd_helpop (InspIRCd* Instance) : command_t(Instance, "HELPOP", 0, 1)
+ {
+ this->source = "m_helpop.so";
+ syntax = "<any-text>";
+ }
CmdResult Handle (const char** parameters, int pcnt, userrec *user)
{
@@ -161,7 +161,7 @@ class ModuleHelpop : public Module
List[I_OnRehash] = List[I_OnWhois] = 1;
}
- virtual void OnRehash(const std::string &parameter)
+ virtual void OnRehash(userrec* user, const std::string &parameter)
{
ReadConfig();
}
diff --git a/src/modules/m_hostchange.cpp b/src/modules/m_hostchange.cpp
index a9bacb867..473a35d12 100644
--- a/src/modules/m_hostchange.cpp
+++ b/src/modules/m_hostchange.cpp
@@ -43,9 +43,8 @@ class ModuleHostChange : public Module
ModuleHostChange(InspIRCd* Me)
: Module::Module(Me)
{
-
Conf = new ConfigReader(ServerInstance);
- OnRehash("");
+ OnRehash(NULL,"");
}
virtual ~ModuleHostChange()
@@ -63,7 +62,7 @@ class ModuleHostChange : public Module
List[I_OnRehash] = List[I_OnUserConnect] = 1;
}
- virtual void OnRehash(const std::string &parameter)
+ virtual void OnRehash(userrec* user, const std::string &parameter)
{
DELETE(Conf);
Conf = new ConfigReader(ServerInstance);
diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp
index a32c62423..579fa8816 100644
--- a/src/modules/m_ident.cpp
+++ b/src/modules/m_ident.cpp
@@ -198,7 +198,7 @@ class ModuleIdent : public Module
List[I_OnCleanup] = List[I_OnRehash] = List[I_OnUserRegister] = List[I_OnCheckReady] = List[I_OnUserDisconnect] = 1;
}
- virtual void OnRehash(const std::string &parameter)
+ virtual void OnRehash(userrec* user, const std::string &parameter)
{
ReadSettings();
}
diff --git a/src/modules/m_inviteexception.cpp b/src/modules/m_inviteexception.cpp
index 0f3581e9e..5da287f2e 100644
--- a/src/modules/m_inviteexception.cpp
+++ b/src/modules/m_inviteexception.cpp
@@ -104,7 +104,7 @@ public:
ie->DoChannelDelete(chan);
}
- virtual void OnRehash(const std::string &param)
+ virtual void OnRehash(userrec* user, const std::string &param)
{
ie->DoRehash();
}
diff --git a/src/modules/m_lockserv.cpp b/src/modules/m_lockserv.cpp
index bb7426a18..f3ac93347 100644
--- a/src/modules/m_lockserv.cpp
+++ b/src/modules/m_lockserv.cpp
@@ -103,7 +103,7 @@ public:
List[I_OnUserRegister] = List[I_OnRehash] = List[I_OnCheckReady] = 1;
}
- virtual void OnRehash(const std::string &parameter)
+ virtual void OnRehash(userrec* user, const std::string &parameter)
{
ResetLocked();
}
diff --git a/src/modules/m_oper_hash.cpp b/src/modules/m_oper_hash.cpp
index b1d80b7eb..23de60a7d 100644
--- a/src/modules/m_oper_hash.cpp
+++ b/src/modules/m_oper_hash.cpp
@@ -84,7 +84,7 @@ class ModuleOperHash : public Module
/* Read the config file first */
Conf = NULL;
- OnRehash("");
+ OnRehash(NULL,"");
ServerInstance->UseInterface("HashRequest");
@@ -126,7 +126,7 @@ class ModuleOperHash : public Module
List[I_OnRehash] = List[I_OnOperCompare] = 1;
}
- virtual void OnRehash(const std::string &parameter)
+ virtual void OnRehash(userrec* user, const std::string &parameter)
{
/* Re-read configuration file */
if (Conf)
diff --git a/src/modules/m_operjoin.cpp b/src/modules/m_operjoin.cpp
index 76ba00ef2..75f809f4a 100644
--- a/src/modules/m_operjoin.cpp
+++ b/src/modules/m_operjoin.cpp
@@ -61,7 +61,7 @@ class ModuleOperjoin : public Module
List[I_OnPostOper] = List[I_OnRehash] = 1;
}
- virtual void OnRehash(const std::string &parameter)
+ virtual void OnRehash(userrec* user, const std::string &parameter)
{
DELETE(conf);
conf = new ConfigReader(ServerInstance);
diff --git a/src/modules/m_operlevels.cpp b/src/modules/m_operlevels.cpp
index 54422f017..f8fdb89d6 100644
--- a/src/modules/m_operlevels.cpp
+++ b/src/modules/m_operlevels.cpp
@@ -50,7 +50,7 @@ class ModuleOperLevels : public Module
List[I_OnRehash] = List[I_OnKill] = 1;
}
- virtual void OnRehash(const std::string &parameter)
+ virtual void OnRehash(userrec* user, const std::string &parameter)
{
DELETE(conf);
conf = new ConfigReader(ServerInstance);
diff --git a/src/modules/m_opermodes.cpp b/src/modules/m_opermodes.cpp
index 63a926407..dbc34bcb5 100644
--- a/src/modules/m_opermodes.cpp
+++ b/src/modules/m_opermodes.cpp
@@ -40,7 +40,7 @@ class ModuleModesOnOper : public Module
List[I_OnPostOper] = List[I_OnRehash] = 1;
}
- virtual void OnRehash(const std::string &parameter)
+ virtual void OnRehash(userrec* user, const std::string &parameter)
{
DELETE(Conf);
Conf = new ConfigReader(ServerInstance);
diff --git a/src/modules/m_opermotd.cpp b/src/modules/m_opermotd.cpp
index 55bc49a3b..a80aa513c 100644
--- a/src/modules/m_opermotd.cpp
+++ b/src/modules/m_opermotd.cpp
@@ -105,7 +105,7 @@ class ModuleOpermotd : public Module
ShowOperMOTD(user);
}
- virtual void OnRehash(const std::string &parameter)
+ virtual void OnRehash(userrec* user, const std::string &parameter)
{
LoadOperMOTD();
}
diff --git a/src/modules/m_override.cpp b/src/modules/m_override.cpp
index d394ea8eb..d86f87b2a 100644
--- a/src/modules/m_override.cpp
+++ b/src/modules/m_override.cpp
@@ -36,13 +36,13 @@ class ModuleOverride : public Module
: Module::Module(Me)
{
// read our config options (main config file)
- OnRehash("");
+ OnRehash(NULL,"");
ServerInstance->SNO->EnableSnomask('O',"OVERRIDE");
OverriddenMode = false;
OverOps = OverDeops = OverVoices = OverDevoices = OverHalfops = OverDehalfops = 0;
}
- virtual void OnRehash(const std::string &parameter)
+ virtual void OnRehash(userrec* user, const std::string &parameter)
{
// on a rehash we delete our classes for good measure and create them again.
ConfigReader* Conf = new ConfigReader(ServerInstance);
diff --git a/src/modules/m_remove.cpp b/src/modules/m_remove.cpp
index e7aa9f7a9..16cc8a679 100644
--- a/src/modules/m_remove.cpp
+++ b/src/modules/m_remove.cpp
@@ -262,7 +262,7 @@ class ModuleRemove : public Module
mycommand2 = new cmd_fpart(ServerInstance, supportnokicks);
ServerInstance->AddCommand(mycommand);
ServerInstance->AddCommand(mycommand2);
- OnRehash("");
+ OnRehash(NULL,"");
}
void Implements(char* List)
@@ -275,7 +275,7 @@ class ModuleRemove : public Module
output.append(" REMOVE");
}
- virtual void OnRehash(const std::string&)
+ virtual void OnRehash(userrec* user, const std::string&)
{
ConfigReader conf(ServerInstance);
supportnokicks = conf.ReadFlag("remove", "supportnokicks", 0);
diff --git a/src/modules/m_restrictchans.cpp b/src/modules/m_restrictchans.cpp
index 27996ffb7..fc83d2e59 100644
--- a/src/modules/m_restrictchans.cpp
+++ b/src/modules/m_restrictchans.cpp
@@ -49,7 +49,7 @@ class ModuleRestrictChans : public Module
ReadConfig();
}
- virtual void OnRehash(const std::string &parameter)
+ virtual void OnRehash(userrec* user, const std::string &parameter)
{
ReadConfig();
}
diff --git a/src/modules/m_sethost.cpp b/src/modules/m_sethost.cpp
index 048756b6d..6e984a62e 100644
--- a/src/modules/m_sethost.cpp
+++ b/src/modules/m_sethost.cpp
@@ -69,7 +69,7 @@ class ModuleSetHost : public Module
ModuleSetHost(InspIRCd* Me)
: Module::Module(Me)
{
- OnRehash("");
+ OnRehash(NULL,"");
mycommand = new cmd_sethost(ServerInstance, hostmap);
ServerInstance->AddCommand(mycommand);
}
@@ -79,7 +79,7 @@ class ModuleSetHost : public Module
List[I_OnRehash] = 1;
}
- void OnRehash(const std::string &parameter)
+ void OnRehash(userrec* user, const std::string &parameter)
{
ConfigReader Conf(ServerInstance);
std::string hmap = Conf.ReadValue("hostname", "charmap", 0);
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp
index c5c4e2a5b..df39864b5 100644
--- a/src/modules/m_spanningtree.cpp
+++ b/src/modules/m_spanningtree.cpp
@@ -2467,7 +2467,7 @@ class TreeSocket : public InspSocket
if (this->Instance->MatchText(this->Instance->Config->ServerName,servermask))
{
- this->Instance->SNO->WriteToSnoMask('l',"Remote rehash initiated from server \002"+prefix+"\002.");
+ this->Instance->SNO->WriteToSnoMask('l',"Remote rehash initiated by \002"+prefix+"\002.");
this->Instance->RehashServer();
Utils->ReadConfiguration(false);
InitializeDisabledCommands(Instance->Config->DisabledCommands, Instance);
@@ -5128,17 +5128,17 @@ class ModuleSpanningTree : public Module
Utils->DoOneToMany(source->nick,"KILL",params);
}
- virtual void OnRehash(const std::string &parameter)
+ virtual void OnRehash(userrec* user, const std::string &parameter)
{
if (parameter != "")
{
std::deque<std::string> params;
params.push_back(parameter);
- Utils->DoOneToMany(ServerInstance->Config->ServerName,"REHASH",params);
+ Utils->DoOneToMany(user ? user->nick : ServerInstance->Config->ServerName, "REHASH", params);
// check for self
if (ServerInstance->MatchText(ServerInstance->Config->ServerName,parameter))
{
- ServerInstance->WriteOpers("*** Remote rehash initiated from server \002%s\002",ServerInstance->Config->ServerName);
+ ServerInstance->WriteOpers("*** Remote rehash initiated locally by \002%s\002", user ? user->nick : ServerInstance->Config->ServerName);
ServerInstance->RehashServer();
}
}
diff --git a/src/modules/m_swhois.cpp b/src/modules/m_swhois.cpp
index 50f6578db..d4432a0d6 100644
--- a/src/modules/m_swhois.cpp
+++ b/src/modules/m_swhois.cpp
@@ -89,7 +89,7 @@ class ModuleSWhois : public Module
ServerInstance->AddCommand(mycommand);
}
- void OnRehash(const std::string &parameter)
+ void OnRehash(userrec* user, const std::string &parameter)
{
DELETE(Conf);
Conf = new ConfigReader(ServerInstance);
diff --git a/src/modules/m_vhost.cpp b/src/modules/m_vhost.cpp
index 2a0280d2e..0a08c7194 100644
--- a/src/modules/m_vhost.cpp
+++ b/src/modules/m_vhost.cpp
@@ -79,7 +79,7 @@ class ModuleVHost : public Module
List[I_OnRehash] = 1;
}
- virtual void OnRehash(const std::string &parameter)
+ virtual void OnRehash(userrec* user, const std::string &parameter)
{
DELETE(Conf);
Conf = new ConfigReader(ServerInstance);