mirror of
https://github.com/anope/anope.git
synced 2026-06-30 21:26:37 +02:00
Delete users and channels from the modestacker when they are destructed
This commit is contained in:
@@ -483,6 +483,11 @@ class CoreExport ModeManager
|
||||
/** Process all of the modes in the stacker and send them to the IRCd to be set on channels/users
|
||||
*/
|
||||
static void ProcessModes();
|
||||
|
||||
/** Delete a user or channel from the stacker
|
||||
* @param b The user/channel
|
||||
*/
|
||||
static void StackerDel(Base *b);
|
||||
};
|
||||
|
||||
#endif // MODES_H
|
||||
|
||||
@@ -47,6 +47,8 @@ Channel::~Channel()
|
||||
{
|
||||
FOREACH_MOD(I_OnChannelDelete, OnChannelDelete(this));
|
||||
|
||||
ModeManager::StackerDel(this);
|
||||
|
||||
Log(NULL, this, "destroy");
|
||||
|
||||
for (std::list<BanData *>::iterator it = this->bd.begin(), it_end = this->bd.end(); it != it_end; ++it)
|
||||
|
||||
@@ -822,3 +822,18 @@ void ModeManager::ProcessModes()
|
||||
StackerObjects.clear();
|
||||
}
|
||||
}
|
||||
|
||||
/** Delete a user or channel from the stacker
|
||||
* @param b The user/channel
|
||||
*/
|
||||
void ModeManager::StackerDel(Base *b)
|
||||
{
|
||||
for (std::list<std::pair<Base *, StackerInfo *> >::iterator it = ModeManager::StackerObjects.begin(), it_end = ModeManager::StackerObjects.end(); it != it_end; ++it)
|
||||
{
|
||||
if (b == it->first)
|
||||
{
|
||||
ModeManager::StackerObjects.erase(it);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -188,10 +188,12 @@ User::~User()
|
||||
|
||||
Log(this, "disconnect") << "(" << this->realname << ") " << "disconnected from the network (" << this->server->GetName() << ")";
|
||||
|
||||
this->Logout();
|
||||
|
||||
FOREACH_MOD(I_OnUserLogoff, OnUserLogoff(this));
|
||||
|
||||
ModeManager::StackerDel(this);
|
||||
this->Logout();
|
||||
|
||||
--usercnt;
|
||||
|
||||
if (is_oper(this))
|
||||
|
||||
Reference in New Issue
Block a user