diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-03-15 17:37:25 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-03-15 17:37:25 +0000 |
commit | 38ca8be9a3881a3cb3cf6864e67b779ffbab6874 (patch) | |
tree | 2f611ef900a80433c881702fbc5ea4c7f1a5da98 /src/modules/m_spanningtree | |
parent | d1dc60e83eef53da5368e18955acfa6c72be0374 (diff) |
Add third parameter to OnUserQuit (quit reason for opers only) - bump api version
Add SetOperQuit and GetOperQuit methods to userrec
Add OPERQUIT command to protocol - bump protocol version
All this is to properly allow hidebans etc to work properly
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6675 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r-- | src/modules/m_spanningtree/main.cpp | 9 | ||||
-rw-r--r-- | src/modules/m_spanningtree/main.h | 4 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treesocket.h | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treesocket2.cpp | 19 |
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> ¶ms); + bool OperQuit(const std::string &prefix, std::deque<std::string> ¶ms); + /** 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> ¶ms) +{ + 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); |