mirror of
https://github.com/anope/anope.git
synced 2026-07-02 01:46:39 +02:00
Move nick register event to make it easier for modules to determine if a newly registered nick is confirmed or not. Add confirm event.
This commit is contained in:
+7
-1
@@ -747,6 +747,12 @@ class CoreExport Module : public Extensible
|
||||
*/
|
||||
virtual void OnNickRegister(User *user, NickAlias *na, const Anope::string &pass) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a nick is confirmed. This will never be called if registration confirmation is not enabled.
|
||||
* @param user The user confirming the nick
|
||||
* @param The account being confirmed
|
||||
*/
|
||||
virtual void OnNickConfirm(User *user, NickCore *) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a nick is suspended
|
||||
* @param na The nick alias
|
||||
*/
|
||||
@@ -1091,7 +1097,7 @@ enum Implementation
|
||||
I_OnAccessClear, I_OnLevelChange, I_OnChanDrop, I_OnChanRegistered, I_OnChanSuspend, I_OnChanUnsuspend,
|
||||
I_OnCreateChan, I_OnDelChan, I_OnChannelCreate, I_OnChannelDelete, I_OnAkickAdd, I_OnAkickDel, I_OnCheckKick,
|
||||
I_OnChanInfo, I_OnCheckPriv, I_OnGroupCheckPriv, I_OnNickDrop, I_OnNickGroup, I_OnNickIdentify,
|
||||
I_OnUserLogin, I_OnNickLogout, I_OnNickRegister, I_OnNickSuspend, I_OnNickUnsuspended, I_OnDelNick, I_OnNickCoreCreate,
|
||||
I_OnUserLogin, I_OnNickLogout, I_OnNickRegister, I_OnNickConfirm, I_OnNickSuspend, I_OnNickUnsuspended, I_OnDelNick, I_OnNickCoreCreate,
|
||||
I_OnDelCore, I_OnChangeCoreDisplay, I_OnNickClearAccess, I_OnNickAddAccess, I_OnNickEraseAccess, I_OnNickClearCert,
|
||||
I_OnNickAddCert, I_OnNickEraseCert, I_OnNickInfo, I_OnBotInfo, I_OnCheckAuthentication, I_OnNickUpdate,
|
||||
I_OnFingerprint, I_OnUserAway, I_OnInvite, I_OnDeleteVhost, I_OnSetVhost, I_OnSetDisplayedHost, I_OnMemoSend, I_OnMemoDel,
|
||||
|
||||
@@ -37,6 +37,7 @@ class CommandNSConfirm : public Command
|
||||
else
|
||||
{
|
||||
na->nc->Shrink<bool>("UNCONFIRMED");
|
||||
FOREACH_MOD(OnNickConfirm, (source.GetUser(), na->nc));
|
||||
Log(LOG_ADMIN, source, this) << "to confirm nick " << na->nick << " (" << na->nc->display << ")";
|
||||
source.Reply(_("Nick \002%s\002 has been confirmed."), na->nick.c_str());
|
||||
}
|
||||
@@ -51,6 +52,7 @@ class CommandNSConfirm : public Command
|
||||
Log(LOG_COMMAND, source, this) << "to confirm their email";
|
||||
source.Reply(_("Your email address of \002%s\002 has been confirmed."), source.nc->email.c_str());
|
||||
nc->Shrink<bool>("UNCONFIRMED");
|
||||
FOREACH_MOD(OnNickConfirm, (source.GetUser(), nc));
|
||||
|
||||
if (source.GetUser())
|
||||
{
|
||||
@@ -198,8 +200,6 @@ class CommandNSRegister : public Command
|
||||
|
||||
Log(LOG_COMMAND, source, this) << "to register " << na->nick << " (email: " << (!na->nc->email.empty() ? na->nc->email : "none") << ")";
|
||||
|
||||
FOREACH_MOD(OnNickRegister, (source.GetUser(), na, pass));
|
||||
|
||||
if (na->nc->GetAccessCount())
|
||||
source.Reply(_("Nickname \002%s\002 registered under your user@host-mask: %s"), u_nick.c_str(), na->nc->GetAccess(0).c_str());
|
||||
else
|
||||
@@ -223,6 +223,8 @@ class CommandNSRegister : public Command
|
||||
}
|
||||
}
|
||||
|
||||
FOREACH_MOD(OnNickRegister, (source.GetUser(), na, pass));
|
||||
|
||||
if (u)
|
||||
{
|
||||
u->Identify(na);
|
||||
|
||||
Reference in New Issue
Block a user