1
0
mirror of https://github.com/anope/anope.git synced 2026-07-04 06:13:11 +02:00

Clean up collide timers on identify, otherwise you can login and logout before the timer tick which will still enforce the collide

This commit is contained in:
Adam
2014-10-06 13:52:43 -04:00
parent 31bc1d6b82
commit be928b5bbc
+24
View File
@@ -11,6 +11,9 @@
#include "module.h"
class NickServCollide;
static std::set<NickServCollide *> collides;
/** Timer for colliding nicks to force people off of nicknames
*/
class NickServCollide : public Timer
@@ -23,6 +26,17 @@ class NickServCollide : public Timer
public:
NickServCollide(Module *me, NickServService *nss, User *user, NickAlias *nick, time_t delay) : Timer(me, delay), service(nss), u(user), ts(user->timestamp), na(nick)
{
collides.insert(this);
}
~NickServCollide()
{
collides.erase(this);
}
User *GetUser()
{
return u;
}
void Tick(time_t t) anope_override
@@ -344,6 +358,16 @@ class NickServCore : public Module, public NickServService
"Your privacy is respected; this e-mail won't be given to\n"
"any third-party person."), Config->StrictPrivmsg.c_str(), NickServ->nick.c_str());
}
for (std::set<NickServCollide *>::iterator it = collides.begin(); it != collides.end(); ++it)
{
NickServCollide *c = *it;
if (c->GetUser() == u)
{
delete c;
break;
}
}
}
void OnNickGroup(User *u, NickAlias *target) anope_override