summaryrefslogtreecommitdiff
path: root/modules/protocol/inspircd20.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-04-28 22:44:34 -0400
committerAdam <Adam@anope.org>2011-05-16 04:09:32 -0400
commit583954d3a1db658281a9afb7b7dd6773726c8c11 (patch)
tree6a00865d5738c6d0bc42efb35f3f468c5876eb3e /modules/protocol/inspircd20.cpp
parent8fb1604f649bec6f356770daf5df6bb8ab811bbf (diff)
Use module type to determine what type each module is instead of its location in the configuration file.
Diffstat (limited to 'modules/protocol/inspircd20.cpp')
-rw-r--r--modules/protocol/inspircd20.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp
index 3cb4979a9..3bc521a63 100644
--- a/modules/protocol/inspircd20.cpp
+++ b/modules/protocol/inspircd20.cpp
@@ -82,7 +82,8 @@ class InspIRCdProto : public InspIRCdTS6Proto
send_cmd("", "CAPAB END");
SendServer(Me);
send_cmd(Config->Numeric, "BURST");
- send_cmd(Config->Numeric, "VERSION :Anope-%s %s :%s - (%s) -- %s", Anope::Version().c_str(), Config->ServerName.c_str(), ircd->name, Config->EncModuleList.begin()->c_str(), Anope::VersionBuildString().c_str());
+ Module *enc = ModuleManager::FindFirstOf(ENCRYPTION);
+ send_cmd(Config->Numeric, "VERSION :Anope-%s %s :%s - (%s) -- %s", Anope::Version().c_str(), Config->ServerName.c_str(), ircd->name, enc ? enc->name.c_str() : "unknown", Anope::VersionBuildString().c_str());
}
};
@@ -731,7 +732,7 @@ class ProtoInspIRCd : public Module
InspIRCdProto ircd_proto;
Inspircd20IRCdMessage ircd_message;
public:
- ProtoInspIRCd(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator),
+ ProtoInspIRCd(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PROTOCOL),
message_endburst("ENDBURST", event_endburst),
message_time("TIME", event_time), message_rsquit("RSQUIT", event_rsquit),
message_svsmode("SVSMODE", OnMode), message_fhost("FHOST", event_chghost),
@@ -743,7 +744,6 @@ class ProtoInspIRCd : public Module
message_metadata("METADATA", event_metadata)
{
this->SetAuthor("Anope");
- this->SetType(PROTOCOL);
pmodule_ircd_var(myIrcd);
pmodule_ircd_proto(&this->ircd_proto);
@@ -753,6 +753,9 @@ class ProtoInspIRCd : public Module
Implementation i[] = { I_OnUserNickChange, I_OnServerSync };
ModuleManager::Attach(i, this, 2);
+
+ if (Config->Numeric.empty())
+ throw ModuleException("This IRCd protocol requires a server id to be set in Anope's configuration.");
}
void OnUserNickChange(User *u, const Anope::string &)