summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/config.cpp8
-rw-r--r--src/users.cpp8
2 files changed, 13 insertions, 3 deletions
diff --git a/src/config.cpp b/src/config.cpp
index 4790cd34d..ae27d7273 100644
--- a/src/config.cpp
+++ b/src/config.cpp
@@ -583,12 +583,14 @@ static bool DoOperType(ServerConfig *config, const Anope::string &, const Anope:
Anope::string inherits = values[1].GetValue();
Anope::string commands = values[2].GetValue();
Anope::string privs = values[3].GetValue();
+ Anope::string modes = values[4].GetValue();
ValueItem vi(name);
if (!ValidateNotEmpty(config, "opertype", "name", vi))
throw ConfigException("One or more values in your configuration file failed to validate. Please see your log for more information.");
OperType *ot = new OperType(name);
+ ot->modes = modes;
Anope::string tok;
spacesepstream cmdstr(commands);
@@ -1220,9 +1222,9 @@ ConfigItems::ConfigItems(ServerConfig *conf)
{DT_STRING},
InitModules, DoModule, DoneModules},
{"opertype",
- {"name", "inherits", "commands", "privs", ""},
- {"", "", "", "", ""},
- {DT_STRING, DT_STRING, DT_STRING, DT_STRING},
+ {"name", "inherits", "commands", "privs", "modes", ""},
+ {"", "", "", "", "", ""},
+ {DT_STRING, DT_STRING, DT_STRING, DT_STRING, DT_STRING},
InitOperTypes, DoOperType, DoneOperTypes},
{"oper",
{"name", "type", "password", "certfp", ""},
diff --git a/src/users.cpp b/src/users.cpp
index 343ef058a..214f3c91b 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -363,6 +363,14 @@ void User::Identify(NickAlias *na)
ircdproto->SetAutoIdentificationToken(this);
FOREACH_MOD(I_OnNickIdentify, OnNickIdentify(this));
+
+ if (na->nc->o != NULL && na->nc->o->ot != NULL && !na->nc->o->ot->modes.empty())
+ {
+ BotInfo *bi = findbot(Config->OperServ);
+ this->SetModes(bi, "%s", na->nc->o->ot->modes.c_str());
+ if (bi != NULL)
+ this->SendMessage(bi, "Changing your usermodes to \002%s\002", na->nc->o->ot->modes.c_str());
+ }
}