summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-11-29 17:09:06 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-11-29 17:09:06 +0000
commitde6a9294e350a7339e280ab3e8a5f4c8d1343660 (patch)
treec45d06c0c2db5044ea5b4de3e7647975c16543d5 /src/modules/m_spanningtree.cpp
parent76f43a55180e8b8e8e3bbb32be3931ca1431666a (diff)
Added opertype to OnOper and added OnMode function
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2010 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree.cpp')
-rw-r--r--src/modules/m_spanningtree.cpp35
1 files changed, 35 insertions, 0 deletions
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;