summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2012-07-09 15:34:44 +0200
committerattilamolnar <attilamolnar@hush.com>2012-09-13 18:51:28 +0200
commit91abba488ad4b2c5bf59c720cde387b6390528d9 (patch)
treed837713670d604ca81dfcd85fde858e464f33e3b
parent1b03dfaeec9b4e4668fe1c02af93ebf4e7f82f73 (diff)
New OnUserSetIP() hook
-rw-r--r--include/modules.h10
-rw-r--r--src/modules.cpp1
2 files changed, 9 insertions, 2 deletions
diff --git a/include/modules.h b/include/modules.h
index 49c16ae61..281da2705 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -116,7 +116,7 @@ struct ModResult {
* and numerical comparisons in preprocessor macros if they wish to support
* multiple versions of InspIRCd in one file.
*/
-#define INSPIRCD_VERSION_API 1
+#define INSPIRCD_VERSION_API 2
/**
* This #define allows us to call a method in all
@@ -338,7 +338,7 @@ enum Implementation
I_OnPostOper, I_OnSyncNetwork, I_OnSetAway, I_OnPostCommand, I_OnPostJoin,
I_OnWhoisLine, I_OnBuildNeighborList, I_OnGarbageCollect, I_OnSetConnectClass,
I_OnText, I_OnPassCompare, I_OnRunTestSuite, I_OnNamesListItem, I_OnNumeric, I_OnHookIO,
- I_OnPreRehash, I_OnModuleRehash, I_OnSendWhoLine, I_OnChangeIdent,
+ I_OnPreRehash, I_OnModuleRehash, I_OnSendWhoLine, I_OnChangeIdent, I_OnSetUserIP,
I_END
};
@@ -1288,6 +1288,12 @@ class CoreExport Module : public classbase, public usecountbase
* @param line The raw line to send; modifiable, if empty no line will be returned.
*/
virtual void OnSendWhoLine(User* source, const std::vector<std::string>& params, User* user, std::string& line);
+
+ /** Called whenever a local user's IP is set for the first time, or when a local user's IP changes due to
+ * a module like m_cgiirc changing it.
+ * @param user The user whose IP is being set
+ */
+ virtual void OnSetUserIP(LocalUser* user);
};
diff --git a/src/modules.cpp b/src/modules.cpp
index ccd78a8f0..075bbf85b 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -176,6 +176,7 @@ ModResult Module::OnNumeric(User*, unsigned int, const std::string&) { return MO
void Module::OnHookIO(StreamSocket*, ListenSocket*) { }
ModResult Module::OnAcceptConnection(int, ListenSocket*, irc::sockets::sockaddrs*, irc::sockets::sockaddrs*) { return MOD_RES_PASSTHRU; }
void Module::OnSendWhoLine(User*, const std::vector<std::string>&, User*, std::string&) { }
+void Module::OnSetUserIP(LocalUser*) { }
ModuleManager::ModuleManager() : ModCount(0)
{