summaryrefslogtreecommitdiff
path: root/src/nickalias.cpp
diff options
context:
space:
mode:
authorAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2010-05-19 06:17:55 +0000
committerAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2010-05-19 06:17:55 +0000
commit3860856dd284353966fe682b2256a6dd6b5f48fe (patch)
treee28535836fad521e2df662e2562da8e5b4319ce4 /src/nickalias.cpp
parent2b4d834f8c5716a7b9309ad2e4eb5d00b48742e7 (diff)
Moved opertype access checking to NickAlises constructor, cleans up some code and fixes bug #1163
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2968 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/nickalias.cpp')
-rw-r--r--src/nickalias.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/nickalias.cpp b/src/nickalias.cpp
index edb717133..669f66c01 100644
--- a/src/nickalias.cpp
+++ b/src/nickalias.cpp
@@ -52,6 +52,26 @@ NickAlias::NickAlias(const std::string &nickname, NickCore *nickcore)
this->nc = nickcore;
slist_add(&nc->aliases, this);
alpha_insert_alias(this);
+
+ for (std::list<std::pair<std::string, std::string> >::iterator it = Config.Opers.begin(); it != Config.Opers.end(); it++)
+ {
+ if (nc->ot)
+ break;
+ if (it->first != this->nick)
+ continue;
+
+ for (std::list<OperType *>::iterator tit = Config.MyOperTypes.begin(); tit != Config.MyOperTypes.end(); tit++)
+ {
+ OperType *ot = *tit;
+
+ if (ot->GetName() == it->second)
+ {
+ Alog() << "Tied oper " << nc->display << " to type " << ot->GetName();
+ nc->ot = ot;
+ break;
+ }
+ }
+ }
}
/** Default destructor