mirror of
https://github.com/anope/anope.git
synced 2026-07-10 04:03:13 +02:00
Fixed some issues and desyncs with creating empty permanent channels on startup & dropping empty channels
This commit is contained in:
@@ -335,7 +335,7 @@ class OSDefcon : public Module
|
||||
OSDefcon(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR), session_service("SessionService", "session"), akills("XLineManager", "xlinemanager/sgline"), commandosdefcon(this)
|
||||
{
|
||||
|
||||
Implementation i[] = { I_OnReload, I_OnChannelModeSet, I_OnChannelModeUnset, I_OnPreCommand, I_OnUserConnect, I_OnChannelModeAdd, I_OnChannelCreate };
|
||||
Implementation i[] = { I_OnReload, I_OnChannelModeSet, I_OnChannelModeUnset, I_OnPreCommand, I_OnUserConnect, I_OnChannelModeAdd, I_OnChannelSync };
|
||||
ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
|
||||
}
|
||||
|
||||
@@ -509,15 +509,7 @@ class OSDefcon : public Module
|
||||
if (DConfig.sessionlimit <= 0 || !session_service)
|
||||
return;
|
||||
|
||||
Session *session;
|
||||
try
|
||||
{
|
||||
session = session_service->FindSession(u->ip);
|
||||
}
|
||||
catch (const SocketException &)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Session *session = session_service->FindSession(u->ip);
|
||||
Exception *exception = session_service->FindException(u);
|
||||
|
||||
if (DConfig.Check(DEFCON_REDUCE_SESSION) && !exception)
|
||||
@@ -553,7 +545,7 @@ class OSDefcon : public Module
|
||||
this->ParseModeString();
|
||||
}
|
||||
|
||||
void OnChannelCreate(Channel *c) anope_override
|
||||
void OnChannelSync(Channel *c) anope_override
|
||||
{
|
||||
if (DConfig.Check(DEFCON_FORCE_CHAN_MODES))
|
||||
c->SetModes(OperServ, false, "%s", DConfig.chanmodes.c_str());
|
||||
|
||||
@@ -406,7 +406,7 @@ class ProtoCharybdis : public Module
|
||||
|
||||
{
|
||||
|
||||
Implementation i[] = { I_OnReload, I_OnChannelCreate, I_OnMLock, I_OnUnMLock };
|
||||
Implementation i[] = { I_OnReload, I_OnChannelSync, I_OnMLock, I_OnUnMLock };
|
||||
ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
|
||||
|
||||
if (ModuleManager::LoadModule("ratbox", User::Find(creator)) != MOD_ERR_OK)
|
||||
@@ -431,7 +431,7 @@ class ProtoCharybdis : public Module
|
||||
sasl = conf->GetModule(this)->Get<bool>("sasl");
|
||||
}
|
||||
|
||||
void OnChannelCreate(Channel *c) anope_override
|
||||
void OnChannelSync(Channel *c) anope_override
|
||||
{
|
||||
if (use_server_side_mlock && c->ci && Servers::Capab.count("MLOCK") > 0)
|
||||
{
|
||||
|
||||
@@ -792,7 +792,7 @@ class ProtoInspIRCd : public Module
|
||||
throw ModuleException("No protocol interface for insp12");
|
||||
ModuleManager::DetachAll(m_insp12);
|
||||
|
||||
Implementation i[] = { I_OnReload, I_OnUserNickChange, I_OnChannelCreate, I_OnChanRegistered, I_OnDelChan, I_OnMLock, I_OnUnMLock, I_OnSetChannelOption };
|
||||
Implementation i[] = { I_OnReload, I_OnUserNickChange, I_OnChannelSync, I_OnChanRegistered, I_OnDelChan, I_OnMLock, I_OnUnMLock, I_OnSetChannelOption };
|
||||
ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
|
||||
}
|
||||
|
||||
@@ -813,7 +813,7 @@ class ProtoInspIRCd : public Module
|
||||
u->RemoveModeInternal(ModeManager::FindUserModeByName("REGISTERED"));
|
||||
}
|
||||
|
||||
void OnChannelCreate(Channel *c) anope_override
|
||||
void OnChannelSync(Channel *c) anope_override
|
||||
{
|
||||
if (c->ci)
|
||||
this->OnChanRegistered(c->ci);
|
||||
|
||||
@@ -1214,7 +1214,7 @@ class ProtoUnreal : public Module
|
||||
|
||||
this->AddModes();
|
||||
|
||||
Implementation i[] = { I_OnReload, I_OnUserNickChange, I_OnChannelCreate, I_OnChanRegistered, I_OnDelChan, I_OnMLock, I_OnUnMLock };
|
||||
Implementation i[] = { I_OnReload, I_OnUserNickChange, I_OnChannelSync, I_OnChanRegistered, I_OnDelChan, I_OnMLock, I_OnUnMLock };
|
||||
ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
|
||||
ModuleManager::SetPriority(this, PRIORITY_FIRST);
|
||||
}
|
||||
@@ -1232,7 +1232,7 @@ class ProtoUnreal : public Module
|
||||
IRCD->SendLogout(u);
|
||||
}
|
||||
|
||||
void OnChannelCreate(Channel *c) anope_override
|
||||
void OnChannelSync(Channel *c) anope_override
|
||||
{
|
||||
if (use_server_side_mlock && Servers::Capab.count("MLOCK") > 0 && c->ci)
|
||||
{
|
||||
|
||||
@@ -340,10 +340,6 @@ class BotServCore : public Module
|
||||
ci->ExtendMetadata("BS_" + token.upper());
|
||||
}
|
||||
|
||||
void OnPreUserKicked(MessageSource &source, ChanUserContainer *cu, const Anope::string &kickmsg) anope_override
|
||||
{
|
||||
}
|
||||
|
||||
void OnUserKicked(MessageSource &source, User *target, const Anope::string &channel, ChannelStatus &status, const Anope::string &kickmsg) anope_override
|
||||
{
|
||||
BotInfo *bi = BotInfo::Find(target->nick);
|
||||
|
||||
@@ -351,7 +351,8 @@ class ChanServCore : public Module
|
||||
|
||||
void OnChannelSync(Channel *c) anope_override
|
||||
{
|
||||
if (!c->HasMode("PERM") && (c->users.empty() || (c->users.size() == 1 && c->ci && c->ci->bi && *c->ci->bi == c->users.begin()->second->user)))
|
||||
bool perm = c->HasMode("PERM") || (c->ci && c->ci->HasExt("PERSIST"));
|
||||
if (!perm && (c->users.empty() || c->users.begin()->second->user->server == Me))
|
||||
{
|
||||
chanserv.Hold(c);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user