1
0
mirror of https://github.com/anope/anope.git synced 2026-07-05 04:53:12 +02:00

Unset all known status modes when we recieve a ts older than ours, and remove split servers from their uplinks

This commit is contained in:
Adam
2010-06-28 10:59:40 -04:00
parent 85b07a94d7
commit 4502038e3d
8 changed files with 83 additions and 45 deletions
-2
View File
@@ -1201,8 +1201,6 @@ void do_part(const char *source, int ac, const char **av)
if (!c)
Alog(LOG_DEBUG) << "Recieved PART from " << user->nick << " for nonexistant channel " << buf;
Alog(LOG_DEBUG) << source << " leaves " << buf;
if (user->FindChannel(c))
{
FOREACH_MOD(I_OnPrePartChannel, OnPrePartChannel(user, c));
+13 -7
View File
@@ -322,15 +322,21 @@ int anope_event_sjoin(const char *source, int ac, const char **av)
c->creation_time = ts;
/* Remove status from all of our users */
for (CUserList::iterator it = c->users.begin(); it != c->users.end(); ++it)
for (std::list<Mode *>::const_iterator it = ModeManager::Modes.begin(), it_end = ModeManager::Modes.end(); it != it_end; ++it)
{
UserContainer *uc = *it;
Mode *m = *it;
c->RemoveMode(NULL, CMODE_OWNER, uc->user->nick);
c->RemoveMode(NULL, CMODE_PROTECT, uc->user->nick);
c->RemoveMode(NULL, CMODE_OP, uc->user->nick);
c->RemoveMode(NULL, CMODE_HALFOP, uc->user->nick);
c->RemoveMode(NULL, CMODE_VOICE, uc->user->nick);
if (m->Type != MODE_STATUS)
continue;
ChannelMode *cm = dynamic_cast<ChannelMode *>(m);
for (CUserList::const_iterator uit = c->users.begin(), uit_end = c->users.end(); uit != uit_end; ++uit)
{
UserContainer *uc = *uit;
c->RemoveMode(NULL, cm, uc->user->nick);
}
}
if (c->ci)
{
+13 -7
View File
@@ -436,15 +436,21 @@ int anope_event_fjoin(const char *source, int ac, const char **av)
c->creation_time = ts;
/* Remove status from all of our users */
for (CUserList::iterator it = c->users.begin(); it != c->users.end(); ++it)
for (std::list<Mode *>::const_iterator it = ModeManager::Modes.begin(), it_end = ModeManager::Modes.end(); it != it_end; ++it)
{
UserContainer *uc = *it;
Mode *m = *it;
c->RemoveMode(NULL, CMODE_OWNER, uc->user->nick);
c->RemoveMode(NULL, CMODE_PROTECT, uc->user->nick);
c->RemoveMode(NULL, CMODE_OP, uc->user->nick);
c->RemoveMode(NULL, CMODE_HALFOP, uc->user->nick);
c->RemoveMode(NULL, CMODE_VOICE, uc->user->nick);
if (m->Type != MODE_STATUS)
continue;
ChannelMode *cm = dynamic_cast<ChannelMode *>(m);
for (CUserList::const_iterator uit = c->users.begin(), uit_end = c->users.end(); uit != uit_end; ++uit)
{
UserContainer *uc = *uit;
c->RemoveMode(NULL, cm, uc->user->nick);
}
}
if (c->ci)
{
+13 -7
View File
@@ -490,15 +490,21 @@ int anope_event_fjoin(const char *source, int ac, const char **av)
c->creation_time = ts;
/* Remove status from all of our users */
for (CUserList::iterator it = c->users.begin(); it != c->users.end(); ++it)
for (std::list<Mode *>::const_iterator it = ModeManager::Modes.begin(), it_end = ModeManager::Modes.end(); it != it_end; ++it)
{
UserContainer *uc = *it;
Mode *m = *it;
c->RemoveMode(NULL, CMODE_OWNER, uc->user->nick);
c->RemoveMode(NULL, CMODE_PROTECT, uc->user->nick);
c->RemoveMode(NULL, CMODE_OP, uc->user->nick);
c->RemoveMode(NULL, CMODE_HALFOP, uc->user->nick);
c->RemoveMode(NULL, CMODE_VOICE, uc->user->nick);
if (m->Type != MODE_STATUS)
continue;
ChannelMode *cm = dynamic_cast<ChannelMode *>(m);
for (CUserList::const_iterator uit = c->users.begin(), uit_end = c->users.end(); uit != uit_end; ++uit)
{
UserContainer *uc = *uit;
c->RemoveMode(NULL, cm, uc->user->nick);
}
}
if (c->ci)
{
+13 -7
View File
@@ -484,15 +484,21 @@ int anope_event_fjoin(const char *source, int ac, const char **av)
c->creation_time = ts;
/* Remove status from all of our users */
for (CUserList::iterator it = c->users.begin(); it != c->users.end(); ++it)
for (std::list<Mode *>::const_iterator it = ModeManager::Modes.begin(), it_end = ModeManager::Modes.end(); it != it_end; ++it)
{
UserContainer *uc = *it;
Mode *m = *it;
c->RemoveMode(NULL, CMODE_OWNER, uc->user->nick);
c->RemoveMode(NULL, CMODE_PROTECT, uc->user->nick);
c->RemoveMode(NULL, CMODE_OP, uc->user->nick);
c->RemoveMode(NULL, CMODE_HALFOP, uc->user->nick);
c->RemoveMode(NULL, CMODE_VOICE, uc->user->nick);
if (m->Type != MODE_STATUS)
continue;
ChannelMode *cm = dynamic_cast<ChannelMode *>(m);
for (CUserList::const_iterator uit = c->users.begin(), uit_end = c->users.end(); uit != uit_end; ++uit)
{
UserContainer *uc = *uit;
c->RemoveMode(NULL, cm, uc->user->nick);
}
}
if (c->ci)
{
+13 -7
View File
@@ -319,15 +319,21 @@ int anope_event_sjoin(const char *source, int ac, const char **av)
c->creation_time = ts;
/* Remove status from all of our users */
for (CUserList::iterator it = c->users.begin(); it != c->users.end(); ++it)
for (std::list<Mode *>::const_iterator it = ModeManager::Modes.begin(), it_end = ModeManager::Modes.end(); it != it_end; ++it)
{
UserContainer *uc = *it;
Mode *m = *it;
c->RemoveMode(NULL, CMODE_OWNER, uc->user->nick);
c->RemoveMode(NULL, CMODE_PROTECT, uc->user->nick);
c->RemoveMode(NULL, CMODE_OP, uc->user->nick);
c->RemoveMode(NULL, CMODE_HALFOP, uc->user->nick);
c->RemoveMode(NULL, CMODE_VOICE, uc->user->nick);
if (m->Type != MODE_STATUS)
continue;
ChannelMode *cm = dynamic_cast<ChannelMode *>(m);
for (CUserList::const_iterator uit = c->users.begin(), uit_end = c->users.end(); uit != uit_end; ++uit)
{
UserContainer *uc = *uit;
c->RemoveMode(NULL, cm, uc->user->nick);
}
}
if (c->ci)
{
+13 -8
View File
@@ -1035,16 +1035,21 @@ int anope_event_sjoin(const char *source, int ac, const char **av)
{
c->creation_time = ts;
/* Remove status from all of our users */
for (CUserList::iterator it = c->users.begin(); it != c->users.end(); ++it)
for (std::list<Mode *>::const_iterator it =ModeManager::Modes.begin(), it_end = ModeManager::Modes.end(); it != it_end; ++it)
{
UserContainer *uc = *it;
Mode *m = *it;
c->RemoveMode(NULL, CMODE_OWNER, uc->user->nick);
c->RemoveMode(NULL, CMODE_PROTECT, uc->user->nick);
c->RemoveMode(NULL, CMODE_OP, uc->user->nick);
c->RemoveMode(NULL, CMODE_HALFOP, uc->user->nick);
c->RemoveMode(NULL, CMODE_VOICE, uc->user->nick);
if (m->Type != MODE_STATUS)
continue;
ChannelMode *cm = dynamic_cast<ChannelMode *>(m);
for (CUserList::const_iterator uit = c->users.begin(), uit_end = c->users.end(); uit != uit_end; ++uit)
{
UserContainer *uc = *uit;
c->RemoveMode(NULL, cm, uc->user->nick);
}
}
if (c->ci)
{
+5
View File
@@ -115,6 +115,11 @@ Server::~Server()
Alog(LOG_DEBUG) << "Finished removing all users for " << GetName();
}
if (UplinkServer)
{
UplinkServer->DelLink(this);
}
if (Links)
{
for (std::list<Server *>::iterator it = Links->begin(), it_end = Links->end(); it != it_end; ++it)