summaryrefslogtreecommitdiff
path: root/src/modules/m_alias.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-09-17 14:11:22 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-09-17 14:11:22 +0000
commit81fda049c16575a0e5d10a20c334ab4fe01d7a6d (patch)
treeecd5ab39c7f8ab9a8bc0bbf1bf7def4167e1ed0b /src/modules/m_alias.cpp
parent0e21e5b642562b199fb53b4f8302596ee592caa0 (diff)
First of many m_alias tidyups, this will eventually become a rewrite of the majority of this module
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5267 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_alias.cpp')
-rw-r--r--src/modules/m_alias.cpp24
1 files changed, 8 insertions, 16 deletions
diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp
index 6a4eaf795..26ab8eae7 100644
--- a/src/modules/m_alias.cpp
+++ b/src/modules/m_alias.cpp
@@ -42,26 +42,24 @@ class Alias : public classbase
class ModuleAlias : public Module
{
private:
- ConfigReader *MyConf;
std::vector<Alias> Aliases;
virtual void ReadAliases()
{
+ ConfigReader MyConf(ServerInstance);
+
Aliases.clear();
- for (int i = 0; i < MyConf->Enumerate("alias"); i++)
+ for (int i = 0; i < MyConf.Enumerate("alias"); i++)
{
Alias a;
std::string txt;
- txt = MyConf->ReadValue("alias", "text", i);
+ txt = MyConf.ReadValue("alias", "text", i);
a.text = txt.c_str();
- a.replace_with = MyConf->ReadValue("alias", "replace", i);
- a.requires = MyConf->ReadValue("alias", "requires", i);
-
- a.uline = ((MyConf->ReadValue("alias", "uline", i) == "yes") ||
- (MyConf->ReadValue("alias", "uline", i) == "1") ||
- (MyConf->ReadValue("alias", "uline", i) == "true"));
-
+ a.replace_with = MyConf.ReadValue("alias", "replace", i);
+ a.requires = MyConf.ReadValue("alias", "requires", i);
+ a.uline = MyConf.ReadFlag("alias", "uline", i);
+
Aliases.push_back(a);
}
@@ -72,8 +70,6 @@ class ModuleAlias : public Module
ModuleAlias(InspIRCd* Me)
: Module::Module(Me)
{
-
- MyConf = new ConfigReader(ServerInstance);
ReadAliases();
}
@@ -84,7 +80,6 @@ class ModuleAlias : public Module
virtual ~ModuleAlias()
{
- DELETE(MyConf);
}
virtual Version GetVersion()
@@ -150,9 +145,6 @@ class ModuleAlias : public Module
virtual void OnRehash(const std::string &parameter)
{
- DELETE(MyConf);
- MyConf = new ConfigReader(ServerInstance);
-
ReadAliases();
}
};