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

Fixed /os reload doing weird things to service channels, and allow setting modes by clients on burst

This commit is contained in:
Adam
2011-09-19 18:35:40 -04:00
parent 7dce64e540
commit 43201ead95
11 changed files with 50 additions and 26 deletions
+1 -1
View File
@@ -64,7 +64,7 @@ void Channel::Reset()
{
UserContainer *uc = *it;
Flags<ChannelModeName, CMODE_END * 2> flags = *debug_cast<Flags<ChannelModeName, CMODE_END * 2> *>(uc->Status);
ChannelStatus flags = *uc->Status;
uc->Status->ClearFlags();
if (findbot(uc->user->nick))
+15 -4
View File
@@ -981,12 +981,23 @@ static bool DoServices(ServerConfig *config, const Anope::string &, const Anope:
{
size_t ch = oldchannels[i].find('#');
Anope::string chname = oldchannels[i].substr(ch != Anope::string::npos ? ch : 0);
if (std::find(bi->botchannels.begin(), bi->botchannels.end(), chname) == bi->botchannels.end())
bool found = false;
for (unsigned j = 0; j < bi->botchannels.size(); ++j)
{
Channel *c = findchan(chname);
if (c)
bi->Part(c);
ch = bi->botchannels[j].find('#');
Anope::string ochname = bi->botchannels[j].substr(ch != Anope::string::npos ? ch : 0);
if (chname.equals_ci(ochname))
found = true;
}
if (found)
continue;
Channel *c = findchan(chname);
if (c)
bi->Part(c);
}
return true;
+4 -8
View File
@@ -350,9 +350,6 @@ void StackerInfo::AddMode(Mode *mode, bool Set, const Anope::string &Param)
*/
void ModeManager::ModePipe::OnNotify()
{
if (!Me || !Me->IsSynced())
return;
ModeManager::ProcessModes();
}
@@ -371,11 +368,6 @@ StackerInfo *ModeManager::GetInfo(Base *Item)
StackerInfo *s = new StackerInfo();
StackerObjects.push_back(std::make_pair(Item, s));
if (mpipe == NULL)
mpipe = new ModePipe();
mpipe->Notify();
return s;
}
@@ -474,6 +466,10 @@ void ModeManager::StackerAddInternal(BotInfo *bi, Base *Object, Mode *mode, bool
s->bi = debug_cast<Channel *>(Object)->ci->WhoSends();
else if (Type == ST_USER)
s->bi = NULL;
if (mpipe == NULL)
mpipe = new ModePipe();
mpipe->Notify();
}
/** Add a user mode to Anope
+3 -1
View File
@@ -61,7 +61,9 @@ Server::Server(Server *uplink, const Anope::string &name, unsigned hops, const A
for (unsigned i = 0; i < bi->botchannels.size(); ++i)
{
size_t h = bi->botchannels[i].find('#');
Anope::string chname = bi->botchannels[i].substr(h != Anope::string::npos ? h : 0);
if (h == Anope::string::npos)
continue;
Anope::string chname = bi->botchannels[i].substr(h);
Channel *c = findchan(chname);
if (c && c->FindUser(bi))
{