summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/channels.cpp2
-rw-r--r--src/config.cpp19
-rw-r--r--src/modes.cpp12
-rw-r--r--src/servers.cpp4
4 files changed, 23 insertions, 14 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index 1778b9f01..2532e23b4 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -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))
diff --git a/src/config.cpp b/src/config.cpp
index 5cb067735..ebe31cbbc 100644
--- a/src/config.cpp
+++ b/src/config.cpp
@@ -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;
diff --git a/src/modes.cpp b/src/modes.cpp
index c3e52e036..4fc5d6483 100644
--- a/src/modes.cpp
+++ b/src/modes.cpp
@@ -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
diff --git a/src/servers.cpp b/src/servers.cpp
index 5a95bb85f..a912fcf1f 100644
--- a/src/servers.cpp
+++ b/src/servers.cpp
@@ -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))
{