summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-02-17 15:29:00 -0500
committerAdam <Adam@anope.org>2011-02-18 11:48:20 -0500
commita1296a3b7c327f6f969b859488006cb69fb68801 (patch)
treefcfcbd0003a9679efb69c19432f0c187c139ef33
parentf38fe242cda9cbe8df9b055ed1f2185468d6d018 (diff)
Changed the OnNickDrop event to call before the nick is deleted
-rw-r--r--include/modules.h5
-rw-r--r--modules/core/ns_drop.cpp4
2 files changed, 5 insertions, 4 deletions
diff --git a/include/modules.h b/include/modules.h
index fd032fe87..4532549f1 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -827,9 +827,10 @@ class CoreExport Module : public Extensible
virtual void OnFindChan(const Anope::string &chname) { }
/** Called when a nick is dropped
- * @param nick The nick
+ * @param u The user dropping the nick
+ * @param na The nick
*/
- virtual void OnNickDrop(const Anope::string &nick) { }
+ virtual void OnNickDrop(User *u, NickAlias *na) { }
/** Called when a nick is forbidden
* @param na The nick alias of the forbidden nick
diff --git a/modules/core/ns_drop.cpp b/modules/core/ns_drop.cpp
index 83981fe0e..ae731e255 100644
--- a/modules/core/ns_drop.cpp
+++ b/modules/core/ns_drop.cpp
@@ -89,11 +89,11 @@ class CommandNSDrop : public Command
ircdproto->SendSQLineDel(&x);
}
+ FOREACH_MOD(I_OnNickDrop, OnNickDrop(u, na));
+
Log(!is_mine ? LOG_OVERRIDE : LOG_COMMAND, u, this) << "to drop nickname " << na->nick << " (group: " << na->nc->display << ") (email: " << (!na->nc->email.empty() ? na->nc->email : "none") << ")";
delete na;
- FOREACH_MOD(I_OnNickDrop, OnNickDrop(!my_nick.empty() ? my_nick : nick));
-
if (!is_mine)
{
source.Reply(_("Nickname \002%s\002 has been dropped."), nick.c_str());