1
0
mirror of https://github.com/anope/anope.git synced 2026-07-09 11:13:13 +02:00

Set the correct opertypes on newly registered users

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2450 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
adam-
2009-08-12 23:52:25 +00:00
parent 577870bb45
commit b9bf72c457
3 changed files with 41 additions and 0 deletions
+5
View File
@@ -726,6 +726,11 @@ E NickAlias *findnick(const std::string &nick);
E NickCore *findcore(const char *nick);
E int is_on_access(User * u, NickCore * nc);
/** Set the correct oper type for a nickcore
* @param nc The nick core
*/
E void SetOperType(NickCore *nc);
/**** operserv.c ****/
E SList akills, sglines, sqlines, szlines;
+2
View File
@@ -64,6 +64,8 @@ class CommandNSConfirm : public Command
if (nr->email)
na->nc->email = sstrdup(nr->email);
SetOperType(na->nc);
if (!force)
{
u->nc = na->nc;
+34
View File
@@ -1344,6 +1344,40 @@ void del_ns_timeout(NickAlias * na, int type)
NickServRelease::ClearTimers(na);
}
/** Set the correct oper type for a nickcore
* @param nc The nick core
*/
void SetOperType(NickCore *nc)
{
for (std::list<std::pair<std::string, std::string> >::iterator it = svsopers_in_config.begin(); it != svsopers_in_config.end(); ++it)
{
std::string nick = it->first;
std::string type = it->second;
NickAlias *na = findnick(nick);
if (!na)
{
/* Nonexistant nick */
continue;
}
if (na->nc == nc)
{
for (std::list<OperType *>::iterator tit = MyOperTypes.begin(); tit != MyOperTypes.end(); ++tit)
{
OperType *ot = *tit;
if (ot->GetName() == type)
{
nc->ot = ot;
alog("%s: Tied oper %s to type %s", s_OperServ, nc->display, type.c_str());
}
}
}
}
}
/*************************************************************************/
/*********************** NickServ command routines ***********************/
/*************************************************************************/