summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/protocol.cpp19
-rw-r--r--src/servers.cpp15
2 files changed, 4 insertions, 30 deletions
diff --git a/src/protocol.cpp b/src/protocol.cpp
index d855e41d8..218478757 100644
--- a/src/protocol.cpp
+++ b/src/protocol.cpp
@@ -478,7 +478,7 @@ bool IRCdMessage::OnSQuit(const Anope::string &source, const std::vector<Anope::
Anope::string buf = s->GetName() + " " + s->GetUplink()->GetName();
- if (s->GetUplink() == Me && Capab.HasFlag(CAPAB_UNCONNECT))
+ if (s->GetUplink() == Me && Capab.count("UNCONNECT") > 0)
{
Log(LOG_DEBUG) << "Sending UNCONNECT SQUIT for " << s->GetName();
/* need to fix */
@@ -516,22 +516,7 @@ bool IRCdMessage::OnWhois(const Anope::string &source, const std::vector<Anope::
bool IRCdMessage::OnCapab(const Anope::string &, const std::vector<Anope::string> &params)
{
for (unsigned i = 0; i < params.size(); ++i)
- {
- spacesepstream sep(params[i]);
- Anope::string token;
-
- while (sep.GetToken(token))
- for (unsigned j = 0; !Capab_Info[j].Token.empty(); ++j)
- {
- if (Capab_Info[j].Token.equals_ci(token))
- {
- Capab.SetFlag(Capab_Info[j].Flag);
- Log(LOG_DEBUG) << "Capab: Enabling " << Capab_Info[j].Token;
- break;
- }
- }
- }
-
+ Capab.insert(params[i]);
return true;
}
diff --git a/src/servers.cpp b/src/servers.cpp
index 51a7608e1..6e4622b29 100644
--- a/src/servers.cpp
+++ b/src/servers.cpp
@@ -16,18 +16,7 @@
/* Anope */
Server *Me = NULL;
-CapabInfo Capab_Info[] = {
- {"NOQUIT", CAPAB_NOQUIT},
- {"TSMODE", CAPAB_TSMODE},
- {"UNCONNECT", CAPAB_UNCONNECT},
- {"QS", CAPAB_QS},
- {"", CAPAB_END}
-};
-
-const Anope::string CapabFlags[] = {
- "NOQUIT", "TSMODE", "UNCONNECT", "QS", ""
-};
-Flags<CapabType, CAPAB_END> Capab(CapabFlags);
+std::set<Anope::string> Capab;
/** Constructor
* @param uplink The uplink this server is from, is only NULL when creating Me
@@ -125,7 +114,7 @@ Server::~Server()
{
Log(this, "quit") << "quit from " << (this->UplinkServer ? this->UplinkServer->GetName() : "no uplink") << " for " << this->QReason;
- if (Capab.HasFlag(CAPAB_NOQUIT) || Capab.HasFlag(CAPAB_QS))
+ if (Capab.count("NOQUIT") > 0 || Capab.count("QS") > 0)
{
for (Anope::insensitive_map<User *>::const_iterator it = UserListByNick.begin(); it != UserListByNick.end();)
{