summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/modules.h4
-rw-r--r--src/modules.cpp2
-rw-r--r--src/users.cpp5
3 files changed, 6 insertions, 5 deletions
diff --git a/include/modules.h b/include/modules.h
index 4120f2cc9..3cd0179d2 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -220,7 +220,7 @@ enum Implementation
I_OnUserPostNick, I_OnPreMode, I_On005Numeric, I_OnKill, I_OnLoadModule,
I_OnUnloadModule, I_OnBackgroundTimer, I_OnPreCommand, I_OnCheckReady, I_OnCheckInvite,
I_OnRawMode, I_OnCheckKey, I_OnCheckLimit, I_OnCheckBan, I_OnCheckChannelBan, I_OnExtBanCheck,
- I_OnChangeLocalUserHost, I_OnPreTopicChange,
+ I_OnPreChangeHost, I_OnPreTopicChange,
I_OnPostTopicChange, I_OnPostConnect, I_OnPostDeoper,
I_OnPreChangeRealName, I_OnUserRegister, I_OnChannelPreDelete, I_OnChannelDelete,
I_OnPostOper, I_OnPostCommand, I_OnPostJoin,
@@ -824,7 +824,7 @@ class CoreExport Module : public classbase, public usecountbase
* @param newhost The new hostname
* @return 1 to deny the host change, 0 to allow
*/
- virtual ModResult OnChangeLocalUserHost(LocalUser* user, const std::string &newhost);
+ virtual ModResult OnPreChangeHost(LocalUser* user, const std::string &newhost);
/** Called whenever a change of a local users real name is attempted.
* return MOD_RES_DENY to deny the name change, or MOD_RES_ALLOW to allow it.
diff --git a/src/modules.cpp b/src/modules.cpp
index 866138728..3a574fdda 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -107,7 +107,7 @@ ModResult Module::OnCheckLimit(User*, Channel*) { DetachEvent(I_OnCheckLimit); r
ModResult Module::OnCheckChannelBan(User*, Channel*) { DetachEvent(I_OnCheckChannelBan); return MOD_RES_PASSTHRU; }
ModResult Module::OnCheckBan(User*, Channel*, const std::string&) { DetachEvent(I_OnCheckBan); return MOD_RES_PASSTHRU; }
ModResult Module::OnExtBanCheck(User*, Channel*, char) { DetachEvent(I_OnExtBanCheck); return MOD_RES_PASSTHRU; }
-ModResult Module::OnChangeLocalUserHost(LocalUser*, const std::string&) { DetachEvent(I_OnChangeLocalUserHost); return MOD_RES_PASSTHRU; }
+ModResult Module::OnPreChangeHost(LocalUser*, const std::string&) { DetachEvent(I_OnPreChangeHost); return MOD_RES_PASSTHRU; }
ModResult Module::OnPreChangeRealName(LocalUser*, const std::string&) { DetachEvent(I_OnPreChangeRealName); return MOD_RES_PASSTHRU; }
ModResult Module::OnPreTopicChange(User*, Channel*, const std::string&) { DetachEvent(I_OnPreTopicChange); return MOD_RES_PASSTHRU; }
ModResult Module::OnPassCompare(Extensible* ex, const std::string &password, const std::string &input, const std::string& hashtype) { DetachEvent(I_OnPassCompare); return MOD_RES_PASSTHRU; }
diff --git a/src/users.cpp b/src/users.cpp
index e05ef1853..e17c8cd79 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -1004,10 +1004,11 @@ bool User::ChangeDisplayedHost(const std::string& shost)
if (GetDisplayedHost() == shost)
return true;
- if (IS_LOCAL(this))
+ LocalUser* luser = IS_LOCAL(this);
+ if (luser)
{
ModResult MOD_RESULT;
- FIRST_MOD_RESULT(OnChangeLocalUserHost, MOD_RESULT, (IS_LOCAL(this),shost));
+ FIRST_MOD_RESULT(OnPreChangeHost, MOD_RESULT, (luser, shost));
if (MOD_RESULT == MOD_RES_DENY)
return false;
}