summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphil-lavin <phil-lavin@5417fbe8-f217-4b02-8779-1006273d7864>2010-05-23 01:25:54 +0000
committerphil-lavin <phil-lavin@5417fbe8-f217-4b02-8779-1006273d7864>2010-05-23 01:25:54 +0000
commit6661c3ebdbd144ab5fb0bf5e85007e2da9e1a5b5 (patch)
tree22b8b1c55981aa9c41b86162cf0b906b37a74c43
parent0c9117abce63f27fb005d6362e35736b87522c51 (diff)
Added param to EVENT_CHANGE_NICK for old nickname
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2978 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r--Changes1
-rw-r--r--docs/EVENTS4
-rw-r--r--src/users.c5
-rw-r--r--version.log3
4 files changed, 10 insertions, 3 deletions
diff --git a/Changes b/Changes
index 96e769598..c72090715 100644
--- a/Changes
+++ b/Changes
@@ -5,6 +5,7 @@ Anope Version 1.8 - SVN
5/12 A Added logging for stateful commands [ #00]
5/22 A Added an internal event called when a nick is ghosted [ #00]
5/22 A Added an internal event called when a nick is recovered [ #00]
+5/23 A Added old nick parameter to EVENT_CHANGE_NICK [ #00]
4/15 F Fixed os_info to backup its database on Windows [ #00]
4/15 F Fixed a potential crash in cs_clear ops [#1154]
4/16 F Fixed missing TS6SID on FJOIN in inspircd12 [ #00]
diff --git a/docs/EVENTS b/docs/EVENTS
index df73bf393..de2ff5422 100644
--- a/docs/EVENTS
+++ b/docs/EVENTS
@@ -280,7 +280,9 @@ Anope Internal Events
EVENT_CHANGE_NICK
A user has just changed it's nick.
- av[0] The new nickname of the user.
+ av[0] The new nickname of the user. Event is called after the user has been changed
+ to this nickname.
+ av[1] The old nickname of the user.
EVENT_CONNECT
This event is emitted when the connection to our uplink hub is being
diff --git a/src/users.c b/src/users.c
index 2f6a6565f..6ce0c2c06 100644
--- a/src/users.c
+++ b/src/users.c
@@ -510,6 +510,7 @@ User *do_nick(const char *source, char *nick, char *username, char *host,
int status = 0; /* Status to apply */
char mask[USERMAX + HOSTMAX + 2];
char *logrealname;
+ char *oldnick;
if (!*source) {
char ipbuf[16];
@@ -743,8 +744,10 @@ User *do_nick(const char *source, char *nick, char *username, char *host,
cancel_user(user);
}
+ oldnick = sstrdup(user->nick);
change_user_nick(user, nick);
- send_event(EVENT_CHANGE_NICK, 1, nick);
+ send_event(EVENT_CHANGE_NICK, 2, nick, oldnick);
+ free(oldnick);
if ((old_na ? old_na->nc : NULL) ==
(user->na ? user->na->nc : NULL))
diff --git a/version.log b/version.log
index ec2c76f44..9501af3f8 100644
--- a/version.log
+++ b/version.log
@@ -9,9 +9,10 @@ VERSION_MAJOR="1"
VERSION_MINOR="8"
VERSION_PATCH="4"
VERSION_EXTRA="-svn"
-VERSION_BUILD="2976"
+VERSION_BUILD="2978"
# $Log$ # Changes since the 1.8.4 Release
+#Revision 2978 - Added param to EVENT_CHANGE_NICK for old nickname
#Revision 2976 - Added internal events called when nick is ghosted and when nick is recovered
#Revision 2969 - Extension to r2952 adding logging for BS BOT
#Revision 2966 - Fixed English in e-mail messages