summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/extra/m_sqllog.cpp2
-rw-r--r--src/modules/m_helpop.cpp8
-rw-r--r--src/modules/m_operjoin.cpp2
-rw-r--r--src/modules/m_opermodes.cpp2
-rw-r--r--src/modules/m_opermotd.cpp2
-rw-r--r--src/modules/m_spanningtree.cpp35
6 files changed, 39 insertions, 12 deletions
diff --git a/src/modules/extra/m_sqllog.cpp b/src/modules/extra/m_sqllog.cpp
index 0596fdc74..d47dc7190 100644
--- a/src/modules/extra/m_sqllog.cpp
+++ b/src/modules/extra/m_sqllog.cpp
@@ -190,7 +190,7 @@ class ModuleSQLLog : public Module
InsertEntry((unsigned)category,(unsigned)nickid,(unsigned)hostid,(unsigned)sourceid,(unsigned long)time(NULL));
}
- virtual void OnOper(userrec* user)
+ virtual void OnOper(userrec* user, std::string opertype)
{
AddLogEntry(LT_OPER,user->nick,user->host,user->server);
}
diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp
index 8df47ce3d..9dbbd088f 100644
--- a/src/modules/m_helpop.cpp
+++ b/src/modules/m_helpop.cpp
@@ -198,14 +198,6 @@ class ModuleHelpop : public Module
}
}
- virtual void OnOper(userrec* user)
- {
- char* modes[2]; // only two parameters
- modes[0] = user->nick; // first parameter is the nick
- modes[1] = "+h"; // second parameter is the mode
- Srv->SendMode(modes,2,user); // send these, forming the command "MODE <nick> +h"
- }
-
virtual ~ModuleHelpop()
{
delete Srv;
diff --git a/src/modules/m_operjoin.cpp b/src/modules/m_operjoin.cpp
index 980fcc651..3609350a2 100644
--- a/src/modules/m_operjoin.cpp
+++ b/src/modules/m_operjoin.cpp
@@ -42,7 +42,7 @@ class ModuleOperjoin : public Module {
}
- virtual void OnOper(userrec* user) {
+ virtual void OnOper(userrec* user, std::string opertype) {
if(operChan != "") {
diff --git a/src/modules/m_opermodes.cpp b/src/modules/m_opermodes.cpp
index 063e675fc..7bfc67f6b 100644
--- a/src/modules/m_opermodes.cpp
+++ b/src/modules/m_opermodes.cpp
@@ -48,7 +48,7 @@ class ModuleModesOnOper : public Module
return Version(1,0,0,1,VF_VENDOR);
}
- virtual void OnOper(userrec* user)
+ virtual void OnOper(userrec* user, std::string opertype)
{
// whenever a user opers, go through the oper types, find their <type:modes>,
// and if they have one apply their modes. The mode string can contain +modes
diff --git a/src/modules/m_opermotd.cpp b/src/modules/m_opermotd.cpp
index ffdb7da90..3d79ab13e 100644
--- a/src/modules/m_opermotd.cpp
+++ b/src/modules/m_opermotd.cpp
@@ -80,7 +80,7 @@ class ModuleOpermotd : public Module {
}
- virtual void OnOper(userrec* user) {
+ virtual void OnOper(userrec* user, std::string opertype) {
ShowOperMOTD(user);
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp
index 172a36a14..38b1f7784 100644
--- a/src/modules/m_spanningtree.cpp
+++ b/src/modules/m_spanningtree.cpp
@@ -604,6 +604,24 @@ class TreeSocket : public InspSocket
return false;
}
+ bool OperType(std::string prefix, std::deque<std::string> params)
+ {
+ if (params.size() != 1)
+ return true;
+ std::string opertype = params[0];
+ userrec* u = Srv->FindNick(prefix);
+ if (u)
+ {
+ strlcpy(u->oper,opertype.c_str(),NICKMAX);
+ if (!strchr(u->modes,"o"))
+ {
+ strcat(u->modes,"o");
+ }
+ DoOneToAllButSender(u->server,"OPERTYPE",params,u->server);
+ }
+ return true;
+ }
+
bool RemoteServer(std::string prefix, std::deque<std::string> params)
{
if (params.size() < 4)
@@ -832,6 +850,10 @@ class TreeSocket : public InspSocket
{
return this->RemoteServer(prefix,params);
}
+ else if (command == "OPERTYPE")
+ {
+ return this->OperType(prefix,params);
+ }
else if (command == "SQUIT")
{
if (params.size() == 2)
@@ -1355,6 +1377,19 @@ class ModuleSpanningTree : public Module
}
}
+ // note: the protocol does not allow direct umode +o except
+ // via NICK with 8 params. sending OPERTYPE infers +o modechange
+ // locally.
+ virtual void OnOper(userrec* user, std::string opertype)
+ {
+ if (std::string(user->server) == Srv->GetServerName())
+ {
+ std::deque<std::string> params;
+ params.push_back(opertype);
+ DoOneToMany(user->nick,"OPERTYPE",params);
+ }
+ }
+
virtual ~ModuleSpanningTree()
{
delete Srv;