diff options
-rw-r--r-- | include/modules.h | 4 | ||||
-rw-r--r-- | src/inspircd.cpp | 15 | ||||
-rw-r--r-- | src/message.cpp | 2 | ||||
-rw-r--r-- | src/modules.cpp | 2 |
4 files changed, 17 insertions, 6 deletions
diff --git a/include/modules.h b/include/modules.h index 35a4caf52..21418ba8a 100644 --- a/include/modules.h +++ b/include/modules.h @@ -436,6 +436,10 @@ class Module : public classbase virtual void ProtoSendMode(void* opaque, int target_type, void* target, std::string modeline); virtual void OnWallops(userrec* user, std::string text); + + virtual void OnChangeHost(userrec* user, std::string newhost); + + virtual void OnChangeName(userrec* user, std::string gecos); /** Called after any nickchange, local or remote. This can be used to track users after nickchanges * have been applied. Please note that although you can see remote nickchanges through this function, you should diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 2f64e621d..fcc91037b 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -571,10 +571,13 @@ chanrec* add_channel(userrec *user, const char* cn, const char* key, bool overri if (!FindChan(cname)) { - MOD_RESULT = 0; - FOREACH_RESULT(OnUserPreJoin(user,NULL,cname)); - if (MOD_RESULT == 1) { - return NULL; + if (strcmp(ServerName,u->server)) + { + MOD_RESULT = 0; + FOREACH_RESULT(OnUserPreJoin(user,NULL,cname)); + if (MOD_RESULT == 1) { + return NULL; + } } /* create a new one */ @@ -604,9 +607,9 @@ chanrec* add_channel(userrec *user, const char* cn, const char* key, bool overri { log(DEBUG,"add_channel: joining to: %s",Ptr->name); - // the override flag allows us to bypass channel modes + // remote users are allowed us to bypass channel modes // and bans (used by servers) - if ((!override) || (!strcasecmp(user->server,ServerName))) + if (!strcasecmp(ServerName,user->server)) { log(DEBUG,"Not overriding..."); MOD_RESULT = 0; diff --git a/src/message.cpp b/src/message.cpp index 4ab697739..2f527c983 100644 --- a/src/message.cpp +++ b/src/message.cpp @@ -218,6 +218,7 @@ void ChangeName(userrec* user, const char* gecos) FOREACH_RESULT(OnChangeLocalUserGECOS(user,gecos)); if (MOD_RESULT) return; + FOREACH_MOD OnChangeName(user,gecos); } strlcpy(user->fullname,gecos,MAXBUF); } @@ -230,6 +231,7 @@ void ChangeDisplayedHost(userrec* user, const char* host) FOREACH_RESULT(OnChangeLocalUserHost(user,host)); if (MOD_RESULT) return; + FOREACH_MOD OnChangeHost(user,host); } strlcpy(user->dhost,host,160); } diff --git a/src/modules.cpp b/src/modules.cpp index a16cc0182..23091fc63 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -368,6 +368,8 @@ void Module::OnSyncUser(userrec* user, Module* proto, void* opaque) { }; void Module::OnSyncChannel(chanrec* chan, Module* proto, void* opaque) { }; void Module::ProtoSendMode(void* opaque, int target_type, void* target, std::string modeline) { }; void Module::OnWallops(userrec* user, std::string text) { }; +void Module::OnChangeHost(userrec* user, std::string newhost) { }; +void Module::OnChangeName(userrec* user, std::string gecos) { }; // server is a wrapper class that provides methods to all of the C-style // exports in the core |