diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-04 18:12:23 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-04 18:12:23 +0000 |
commit | d68dcc665827575df74156f08b22451f98aaaef6 (patch) | |
tree | aebcd408dd91512560111917eec18629def49097 /src | |
parent | b54f879f3539c298646449ede2e8d458fc305605 (diff) |
Added the module method OnUserPostNick for capturing a nickchange AFTER it has taken place
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@976 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/commands.cpp | 8 | ||||
-rw-r--r-- | src/modules.cpp | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/commands.cpp b/src/commands.cpp index 2ae4e0049..ef95d1f3f 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -1650,9 +1650,11 @@ void handle_nick(char **parameters, int pcnt, userrec *user) char buffer[MAXBUF]; snprintf(buffer,MAXBUF,"n %s %s",user->nick,parameters[0]); NetSendToAll(buffer); - } + char oldnick[NICKMAX]; + strlcpy(oldnick,user->nick,NICKMAX); + /* change the nick of the user in the users_hash */ user = ReHashNick(user->nick, parameters[0]); /* actually change the nick within the record */ @@ -1677,6 +1679,10 @@ void handle_nick(char **parameters, int pcnt, userrec *user) /* user is registered now, bit 0 = USER command, bit 1 = sent a NICK command */ ConnectUser(user); } + if (user->registered == 7) + { + FOREACH_MOD OnUserPostNick(user,oldnick); + } } diff --git a/src/modules.cpp b/src/modules.cpp index fff5f1c7b..a575c3fde 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -321,6 +321,7 @@ int Module::OnUserPreInvite(userrec* source,userrec* dest,chanrec* channel) { re int Module::OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text) { return 0; }; int Module::OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text) { return 0; }; int Module::OnUserPreNick(userrec* user, std::string newnick) { return 0; }; +void Module::OnUserPostNick(userrec* user, std::string oldnick) { }; int Module::OnAccessCheck(userrec* source,userrec* dest,chanrec* channel,int access_type) { return ACR_DEFAULT; }; string_list Module::OnUserSync(userrec* user) { string_list empty; return empty; } string_list Module::OnChannelSync(chanrec* chan) { string_list empty; return empty; } |