summaryrefslogtreecommitdiff
path: root/src/config.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-05-18 12:25:26 -0400
committerAdam <Adam@anope.org>2013-05-18 12:25:26 -0400
commit3253455792568eda3f688916b533cb814b9996fb (patch)
treebb6cda179ff0cdc60d6afb86471c931683bb6324 /src/config.cpp
parent879b31058065537d2e30bd74f71403800dd19cf4 (diff)
Tabify some stuff in config.cpp
Diffstat (limited to 'src/config.cpp')
-rw-r--r--src/config.cpp112
1 files changed, 56 insertions, 56 deletions
diff --git a/src/config.cpp b/src/config.cpp
index afadb401b..07b51f99e 100644
--- a/src/config.cpp
+++ b/src/config.cpp
@@ -318,63 +318,63 @@ Conf::Conf() : Block("")
bi = new BotInfo(nick, user, host, gecos, modes);
bi->conf = true;
- std::vector<Anope::string> oldchannels = bi->botchannels;
- bi->botchannels.clear();
- commasepstream sep(channels);
+ std::vector<Anope::string> oldchannels = bi->botchannels;
+ bi->botchannels.clear();
+ commasepstream sep(channels);
for (Anope::string token; sep.GetToken(token);)
- {
- bi->botchannels.push_back(token);
- size_t ch = token.find('#');
- Anope::string chname, want_modes;
- if (ch == Anope::string::npos)
- chname = token;
- else
- {
- want_modes = token.substr(0, ch);
- chname = token.substr(ch);
- }
- bi->Join(chname);
- Channel *c = Channel::Find(chname);
- if (!c)
- continue; // Can't happen
-
- /* Remove all existing modes */
- ChanUserContainer *cu = c->FindUser(bi);
- if (cu != NULL)
- for (size_t j = 0; j < cu->status.Modes().length(); ++j)
- c->RemoveMode(bi, ModeManager::FindChannelModeByChar(cu->status.Modes()[j]), bi->GetUID());
- /* Set the new modes */
- for (unsigned j = 0; j < want_modes.length(); ++j)
- {
- ChannelMode *cm = ModeManager::FindChannelModeByChar(want_modes[j]);
- if (cm == NULL)
- cm = ModeManager::FindChannelModeByChar(ModeManager::GetStatusChar(want_modes[j]));
- if (cm && cm->type == MODE_STATUS)
- c->SetMode(bi, cm, bi->GetUID());
- }
- }
- for (unsigned k = 0; k < oldchannels.size(); ++k)
- {
- size_t ch = oldchannels[k].find('#');
- Anope::string chname = oldchannels[k].substr(ch != Anope::string::npos ? ch : 0);
-
- bool found = false;
- for (unsigned j = 0; j < bi->botchannels.size(); ++j)
- {
- 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 = Channel::Find(chname);
- if (c)
- bi->Part(c);
- }
+ {
+ bi->botchannels.push_back(token);
+ size_t ch = token.find('#');
+ Anope::string chname, want_modes;
+ if (ch == Anope::string::npos)
+ chname = token;
+ else
+ {
+ want_modes = token.substr(0, ch);
+ chname = token.substr(ch);
+ }
+ bi->Join(chname);
+ Channel *c = Channel::Find(chname);
+ if (!c)
+ continue; // Can't happen
+
+ /* Remove all existing modes */
+ ChanUserContainer *cu = c->FindUser(bi);
+ if (cu != NULL)
+ for (size_t j = 0; j < cu->status.Modes().length(); ++j)
+ c->RemoveMode(bi, ModeManager::FindChannelModeByChar(cu->status.Modes()[j]), bi->GetUID());
+ /* Set the new modes */
+ for (unsigned j = 0; j < want_modes.length(); ++j)
+ {
+ ChannelMode *cm = ModeManager::FindChannelModeByChar(want_modes[j]);
+ if (cm == NULL)
+ cm = ModeManager::FindChannelModeByChar(ModeManager::GetStatusChar(want_modes[j]));
+ if (cm && cm->type == MODE_STATUS)
+ c->SetMode(bi, cm, bi->GetUID());
+ }
+ }
+ for (unsigned k = 0; k < oldchannels.size(); ++k)
+ {
+ size_t ch = oldchannels[k].find('#');
+ Anope::string chname = oldchannels[k].substr(ch != Anope::string::npos ? ch : 0);
+
+ bool found = false;
+ for (unsigned j = 0; j < bi->botchannels.size(); ++j)
+ {
+ 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 = Channel::Find(chname);
+ if (c)
+ bi->Part(c);
+ }
}
for (int i = 0; i < this->CountBlock("log"); ++i)