X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/blobdiff_plain/5e86e0b70415747307b886fe71c19b2cafeede69..e372a0406bcb1e47974b5b2af929f9198c37652a:/nick/nick.c diff --git a/nick/nick.c b/nick/nick.c index 33e32386..f04f1df1 100644 --- a/nick/nick.c +++ b/nick/nick.c @@ -38,6 +38,8 @@ const flag umodeflags[] = { { 'R', UMODE_REGPRIV }, { 'I', UMODE_HIDEIDLE }, { 'P', UMODE_PARANOID }, + { 'q', UMODE_COMCHANS }, + { 'Q', UMODE_COMCHANSRESTR }, { 'C', UMODE_CLOAKED }, { '\0', 0 } }; @@ -49,7 +51,7 @@ const flag accountflags[] = { { 'd', AFLAG_DEVELOPER }, { '\0', 0 } }; -#define nickhash(x) ((crc32i(x))%NICKHASHSIZE) +#define nickhash(x) ((irc_crc32i(x))%NICKHASHSIZE) nick *nicktable[NICKHASHSIZE]; nick **servernicks[MAXSERVERS]; @@ -77,7 +79,7 @@ void _init() { * before we register all our hooks which would otherwise get called * during the disconnect. */ if (connected) { - irc_send("%s SQ %s 0 :Resync [adding nick support]",mynumeric->content,myserver->content); irc_disconnected(); + irc_send("%s SQ %s 0 :Resync [adding nick support]",mynumeric->content,myserver->content); irc_disconnected(0); } /* Register our hooks */ @@ -173,6 +175,9 @@ void handleserverchange(int hooknum, void *arg) { void deletenick(nick *np) { nick **nh; + /* Fire a pre-lostnick trigger to allow hooks to check the channels etc. of a lost nick */ + triggerhook(HOOK_NICK_PRE_LOSTNICK, np); + /* Fire the hook. This will deal with removal from channels etc. */ triggerhook(HOOK_NICK_LOSTNICK, np); @@ -216,6 +221,7 @@ void deletenick(nick *np) { freesstring(np->shident); /* freesstring(NULL) is OK */ freesstring(np->sethost); freesstring(np->opername); + freesstring(np->message); node_decrement_usercount(np->ipnode); derefnode(iptree, np->ipnode); @@ -465,6 +471,9 @@ void clearcloaktargets(nick *cloaked) nick *tnp; int j; + if (cloaked->cloak_count == 0) + return; + for(j=0;jnext) if (tnp->cloak_extra == cloaked)