diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-12-05 08:59:12 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-12-05 08:59:12 +0000 |
commit | ace0f7f83f3322cc3b251835c7a44d63c8d8acb3 (patch) | |
tree | fbb9261f74e8cddb0c11a48798d2f7e1fbc7e478 | |
parent | e962708ca03d7c593e4119c487eb8e0d591ef6d7 (diff) |
Added OnChangeHost
Added OnChangeName
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2181 e03df62e-2008-0410-955e-edbf42e46eb7
-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 |