summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r--src/modules/m_spanningtree/main.cpp9
-rw-r--r--src/modules/m_spanningtree/main.h4
-rw-r--r--src/modules/m_spanningtree/treesocket.h2
-rw-r--r--src/modules/m_spanningtree/treesocket2.cpp19
4 files changed, 31 insertions, 3 deletions
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index 31f8a1f10..1f2509d4e 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -904,11 +904,18 @@ void ModuleSpanningTree::OnUserConnect(userrec* user)
}
}
-void ModuleSpanningTree::OnUserQuit(userrec* user, const std::string &reason)
+void ModuleSpanningTree::OnUserQuit(userrec* user, const std::string &reason, const std::string &oper_message)
{
if ((IS_LOCAL(user)) && (user->registered == REG_ALL))
{
std::deque<std::string> params;
+
+ if (oper_message != reason)
+ {
+ params.push_back(":"+oper_message);
+ Utils->DoOneToMany(user->nick,"OPERQUIT",params);
+ }
+ params.clear();
params.push_back(":"+reason);
Utils->DoOneToMany(user->nick,"QUIT",params);
}
diff --git a/src/modules/m_spanningtree/main.h b/src/modules/m_spanningtree/main.h
index da0860eac..4bf11ddd7 100644
--- a/src/modules/m_spanningtree/main.h
+++ b/src/modules/m_spanningtree/main.h
@@ -13,7 +13,7 @@
* Failure to document your protocol changes will result in a painfully
* painful death by pain. You have been warned.
*/
-const long ProtocolVersion = 1104;
+const long ProtocolVersion = 1105;
/** Forward declarations
*/
@@ -137,7 +137,7 @@ class ModuleSpanningTree : public Module
virtual void OnChangeName(userrec* user, const std::string &gecos);
virtual void OnUserPart(userrec* user, chanrec* channel, const std::string &partmessage);
virtual void OnUserConnect(userrec* user);
- virtual void OnUserQuit(userrec* user, const std::string &reason);
+ virtual void OnUserQuit(userrec* user, const std::string &reason, const std::string &oper_message);
virtual void OnUserPostNick(userrec* user, const std::string &oldnick);
virtual void OnUserKick(userrec* source, userrec* user, chanrec* chan, const std::string &reason);
virtual void OnRemoteKill(userrec* source, userrec* dest, const std::string &reason);
diff --git a/src/modules/m_spanningtree/treesocket.h b/src/modules/m_spanningtree/treesocket.h
index 52496a4ef..5a5ec52f8 100644
--- a/src/modules/m_spanningtree/treesocket.h
+++ b/src/modules/m_spanningtree/treesocket.h
@@ -240,6 +240,8 @@ class TreeSocket : public InspSocket
*/
bool ForceNick(const std::string &prefix, std::deque<std::string> &params);
+ bool OperQuit(const std::string &prefix, std::deque<std::string> &params);
+
/** Remote SQUIT (RSQUIT). Routing works similar to SVSNICK: Route it to the server that the target is connected to locally,
* then let that server do the dirty work (squit it!). Example:
* A -> B -> C -> D: oper on A squits D, A routes to B, B routes to C, C notices D connected locally, kills it. -- w00t
diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp
index fe56ea1bf..8bb404a45 100644
--- a/src/modules/m_spanningtree/treesocket2.cpp
+++ b/src/modules/m_spanningtree/treesocket2.cpp
@@ -207,6 +207,21 @@ bool TreeSocket::ForceNick(const std::string &prefix, std::deque<std::string> &p
return true;
}
+bool TreeSocket::OperQuit(const std::string &prefix, std::deque<std::string> &params)
+{
+ if (params.size() < 1)
+ return true;
+
+ userrec* u = this->Instance->FindNick(prefix);
+
+ if (u)
+ {
+ Utils->DoOneToAllButSender(prefix,"OPERQUIT",params,prefix);
+ u->SetOperQuit(params[0]);
+ }
+ return true;
+}
+
/*
* Remote SQUIT (RSQUIT). Routing works similar to SVSNICK: Route it to the server that the target is connected to locally,
* then let that server do the dirty work (squit it!). Example:
@@ -1157,6 +1172,10 @@ bool TreeSocket::ProcessLine(std::string &line)
}
return this->ForceNick(prefix,params);
}
+ else if (command == "OPERQUIT")
+ {
+ return this->OperQuit(prefix,params);
+ }
else if (command == "RSQUIT")
{
return this->RemoteSquit(prefix, params);