mirror of
https://github.com/anope/anope.git
synced 2026-07-02 07:46:40 +02:00
added 9 new events
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2387 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
+3
-3
@@ -24,7 +24,7 @@ class NickRequest
|
||||
|
||||
class NickCore;
|
||||
|
||||
class CoreExport NickAlias
|
||||
class CoreExport NickAlias : public Extensible
|
||||
{
|
||||
public:
|
||||
NickAlias();
|
||||
@@ -48,14 +48,14 @@ class CoreExport NickCore : public Extensible
|
||||
NickCore *next, *prev;
|
||||
|
||||
char *display; /* How the nick is displayed */
|
||||
char pass[PASSMAX]; /* Password of the nicks */
|
||||
char pass[PASSMAX]; /* Password of the nicks */
|
||||
char *email; /* E-mail associated to the nick */
|
||||
char *greet; /* Greet associated to the nick */
|
||||
uint32 icq; /* ICQ # associated to the nick */
|
||||
char *url; /* URL associated to the nick */
|
||||
uint32 flags; /* See NI_* below */
|
||||
uint16 language; /* Language selected by nickname owner (LANG_*) */
|
||||
std::vector<std::string> access; /* Access list, vector of strings */
|
||||
std::vector<std::string> access; /* Access list, vector of strings */
|
||||
MemoInfo memos;
|
||||
uint16 channelcount; /* Number of channels currently registered */
|
||||
|
||||
|
||||
+49
-2
@@ -676,7 +676,7 @@ class CoreExport Module
|
||||
/** Called when a user disconnects
|
||||
* @param nick The name of the user
|
||||
*/
|
||||
virtual void OnUserLogoff(const char *nick) { }
|
||||
virtual void OnUserLogoff(User *u) { }
|
||||
|
||||
/** Called when a new bot is made
|
||||
* @param bi The bot
|
||||
@@ -792,6 +792,52 @@ class CoreExport Module
|
||||
* @param level The level
|
||||
*/
|
||||
virtual void OnDefconLevel(int level) { }
|
||||
|
||||
/** Called on findnick()
|
||||
* @param nick nickname to be searched for
|
||||
*/
|
||||
virtual void OnFindNick(const std::string &nick) { }
|
||||
|
||||
/** Called on delnick()
|
||||
* @ param na pointer to the nickalias
|
||||
*/
|
||||
virtual void OnDelNick(NickAlias *na) { }
|
||||
|
||||
/* Called on findcore()
|
||||
* @param nick nickname to be searched for (nc->display)
|
||||
*/
|
||||
virtual void OnFindCore(const std::string &nick) { }
|
||||
|
||||
/** Called on delcore()
|
||||
* @param nc pointer to the NickCore
|
||||
*/
|
||||
virtual void OnDelCore(NickCore *nc) { }
|
||||
|
||||
/** Called on change_core_display()
|
||||
* @param nc pointer to the NickCore
|
||||
* @param newdisplay the new display
|
||||
*/
|
||||
virtual void OnChangeCoreDisplay(NickCore *nc, const std::string &newdisplay) { }
|
||||
|
||||
/** Called on findrequestnick()
|
||||
* @param nick nicname to be searched for
|
||||
*/
|
||||
virtual void OnFindRequestNick(const std::string &nick) { }
|
||||
|
||||
/** called from ns_register.c, after the NickRequest have been created
|
||||
* @param nr pointer to the NickRequest
|
||||
*/
|
||||
virtual void OnMakeNickRequest(NickRequest *nr) { }
|
||||
|
||||
/** called on delnickrequest()
|
||||
* @param nr pointer to the NickRequest
|
||||
*/
|
||||
virtual void OnDelNickRequest(NickRequest *nr) { }
|
||||
|
||||
/** called from NickCore::ClearAccess()
|
||||
* @param nc pointer to the NickCore
|
||||
*/
|
||||
virtual void OnNickClearAccess(NickCore *nc) { }
|
||||
};
|
||||
|
||||
|
||||
@@ -803,13 +849,14 @@ enum Implementation
|
||||
/* NickServ */
|
||||
I_OnNickExpire, I_OnNickForbidden, I_OnNickGroup, I_OnNickLogout, I_OnNickIdentify, I_OnNickDrop,
|
||||
I_OnNickRegister, I_OnNickSuspended, I_OnNickUnsuspended,
|
||||
I_OnFindNick, I_OnDelNick, I_OnFindCore, I_OnDelCore, I_OnChangeCoreDisplay,
|
||||
I_OnFindRequestNick, I_OnDelNickRequest, I_OnMakeNickRequest, I_OnNickClearAccess,
|
||||
|
||||
/* ChanServ */
|
||||
I_OnChanForbidden, I_OnChanSuspend, I_OnChanDrop, I_OnChanExpire, I_OnAccessAdd, I_OnAccessChange,
|
||||
I_OnAccessDel, I_OnAccessClear, I_OnChanRegistered, I_OnChanUnsuspend,
|
||||
|
||||
/* BotServ */
|
||||
|
||||
I_OnBotJoin, I_OnBotKick, I_OnBotCreate, I_OnBotChange, I_OnBotDelete, I_OnBotAssign, I_OnBotUnAssign,
|
||||
I_OnUserKicked, I_OnBotFantasy, I_OnBotNoFantasyAccess, I_OnBotBan,
|
||||
|
||||
|
||||
@@ -305,6 +305,7 @@ class CommandNSRegister : public CommandNSConfirm
|
||||
if (email)
|
||||
nr->email = sstrdup(email);
|
||||
nr->requested = time(NULL);
|
||||
FOREACH_MOD(I_OnMakeNickRequest, OnMakeNickRequest(nr));
|
||||
if (NSEmailReg)
|
||||
{
|
||||
if (!do_sendregmail(u, nr))
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "services.h"
|
||||
#include "pseudo.h"
|
||||
|
||||
NickCore::NickCore()
|
||||
{
|
||||
@@ -74,5 +75,6 @@ void NickCore::EraseAccess(const std::string &entry)
|
||||
|
||||
void NickCore::ClearAccess()
|
||||
{
|
||||
FOREACH_MOD(I_OnNickClearAccess, OnNickClearAccess(this));
|
||||
access.clear();
|
||||
}
|
||||
|
||||
+18
-1
@@ -851,10 +851,14 @@ NickRequest *findrequestnick(const char *nick)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
FOREACH_MOD(I_OnFindRequestNick, OnFindRequestNick(nick));
|
||||
|
||||
for (nr = nrlists[HASH(nick)]; nr; nr = nr->next)
|
||||
{
|
||||
if (stricmp(nr->nick, nick) == 0)
|
||||
{
|
||||
return nr;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -875,12 +879,15 @@ NickAlias *findnick(const char *nick)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
FOREACH_MOD(I_OnFindNick, OnFindNick(nick));
|
||||
|
||||
for (na = nalists[HASH(nick)]; na; na = na->next)
|
||||
{
|
||||
if (stricmp(na->nick, nick) == 0)
|
||||
{
|
||||
return na;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -907,10 +914,14 @@ NickCore *findcore(const char *nick)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
FOREACH_MOD(I_OnFindCore, OnFindCore(nick));
|
||||
|
||||
for (nc = nclists[HASH(nick)]; nc; nc = nc->next)
|
||||
{
|
||||
if (stricmp(nc->display, nick) == 0)
|
||||
{
|
||||
return nc;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -1070,6 +1081,7 @@ void change_core_display(NickCore * nc, const char *newdisplay)
|
||||
}
|
||||
*/
|
||||
/* Log ... */
|
||||
FOREACH_MOD(I_OnChangeCoreDisplay, OnChangeCoreDisplay(nc, newdisplay));
|
||||
alog("%s: changing %s nickname group display to %s", s_NickServ,
|
||||
nc->display, newdisplay);
|
||||
|
||||
@@ -1108,6 +1120,8 @@ static int delcore(NickCore * nc)
|
||||
int i;
|
||||
User *user;
|
||||
|
||||
FOREACH_MOD(I_OnDelCore, OnDelCore(nc));
|
||||
|
||||
/* Clean up this nick core from any users online using it
|
||||
* (ones that /nick but remain unidentified)
|
||||
*/
|
||||
@@ -1171,6 +1185,7 @@ int delnickrequest(NickRequest * nr)
|
||||
{
|
||||
if (nr)
|
||||
{
|
||||
FOREACH_MOD(I_OnDelNickRequest, OnDelNickRequest(nr));
|
||||
nrlists[HASH(nr->nick)] = nr->next;
|
||||
if (nr->nick)
|
||||
delete [] nr->nick;
|
||||
@@ -1201,6 +1216,8 @@ int delnick(NickAlias * na)
|
||||
NickServCollide::ClearTimers(na);
|
||||
NickServRelease::ClearTimers(na, true);
|
||||
|
||||
FOREACH_MOD(I_OnDelNick, OnDelNick(na));
|
||||
|
||||
/* Second thing to do: look for an user using the alias
|
||||
* being deleted, and make appropriate changes */
|
||||
if ((u = finduser(na->nick)))
|
||||
|
||||
+1
-1
@@ -227,7 +227,7 @@ User::~User()
|
||||
delete [] srealname;
|
||||
}
|
||||
|
||||
FOREACH_MOD(I_OnUserLogoff, OnUserLogoff(this->nick));
|
||||
FOREACH_MOD(I_OnUserLogoff, OnUserLogoff(this));
|
||||
|
||||
if (debug >= 2)
|
||||
alog("debug: User::~User() called");
|
||||
|
||||
Reference in New Issue
Block a user