#include "../chanserv.h"
#include "../../core/hooks.h"
#include "../../nick/nick.h"
+#include "../../lib/irc_string.h"
#include <time.h>
#include <string.h>
+#define NTERFACER_AUTH "nterfacer"
+
/* OK, we need to deal separately with users who have definitely gone (QUIT
* or KILL) and those who has mysteriously vanished (lost in netsplit).
* There are hooks for all these things, but sadly QUIT and KILL also
unsigned long at_lastuserid;
unsigned long at_getuserid(nick *np) {
- reguser *rup;
-
/* If they are not +r, forget it. */
if (!IsAccount(np))
return 0;
+
+ /* Ignore that pesky nterfacer */
+#ifdef NTERFACER_AUTH
+ if (!ircd_strcmp(np->authname, NTERFACER_AUTH))
+ return 0;
+#endif
- /* Try getting it from np->auth */
+ /* Use the userid from authext only. */
if (np->auth)
return np->auth->userid;
- /* Else use the chanserv nickext */
- if ((rup=getreguserfromnick(np)))
- return rup->ID;
-
Error("authtracker",ERR_WARNING,"Unable to get userID from IsAccount() user %s",np->nick);
return 0;
}
nick *np=args[0];
char *reason=args[1];
char *rreason;
+ char resbuf[512];
unsigned long userid;
/* Ignore unauthed users, or those with no accountts */
at_lastauthts=np->accountts;
at_lastnum=np->numeric;
- if (hooknum==HOOK_NICK_KILL && (rreason=strchr(reason,'@')))
- reason=rreason;
+ if (hooknum==HOOK_NICK_KILL && (rreason=strchr(reason,' '))) {
+ sprintf(resbuf,"Killed%s",rreason);
+ reason=resbuf;
+ }
at_logquit(userid, np->accountts, time(NULL), reason);
}
registerhook(HOOK_NICK_QUIT, at_handlequitorkill);
registerhook(HOOK_NICK_KILL, at_handlequitorkill);
registerhook(HOOK_NICK_LOSTNICK, at_handlelostnick);
- registerhook(HOOK_CHANSERV_SETUSERID, at_newnick);
+ registerhook(HOOK_NICK_NEWNICK, at_newnick);
+ registerhook(HOOK_NICK_ACCOUNT, at_newnick);
registerhook(HOOK_SERVER_LINKED, at_serverlinked);
}
deregisterhook(HOOK_NICK_QUIT, at_handlequitorkill);
deregisterhook(HOOK_NICK_KILL, at_handlequitorkill);
deregisterhook(HOOK_NICK_LOSTNICK, at_handlelostnick);
- deregisterhook(HOOK_CHANSERV_SETUSERID, at_newnick);
+ deregisterhook(HOOK_NICK_NEWNICK, at_newnick);
+ deregisterhook(HOOK_NICK_ACCOUNT, at_newnick);
deregisterhook(HOOK_SERVER_LINKED, at_serverlinked);
}