summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/ns_register.c2
-rw-r--r--src/nickserv.c34
2 files changed, 36 insertions, 0 deletions
diff --git a/src/core/ns_register.c b/src/core/ns_register.c
index 9ed66529b..958e4d94b 100644
--- a/src/core/ns_register.c
+++ b/src/core/ns_register.c
@@ -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;
diff --git a/src/nickserv.c b/src/nickserv.c
index 88371b3db..032d1fd4e 100644
--- a/src/nickserv.c
+++ b/src/nickserv.c
@@ -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 ***********************/
/*************************************************************************/