From d9d348056a1713ff9fd20deab74f3279394ee17e Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 2 Dec 2005 20:03:02 +0000 Subject: Made routing of NOTICE/PRIVMSG to users cleverer git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2121 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree.cpp | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index da745dff5..d63075b78 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -63,7 +63,7 @@ class TreeSocket; bool DoOneToOne(std::string prefix, std::string command, std::deque params, std::string target); bool DoOneToAllButSender(std::string prefix, std::string command, std::deque params, std::string omit); bool DoOneToMany(std::string prefix, std::string command, std::deque params); -bool DoOneToAllButSenderRaw(std::string data,std::string omit); +bool DoOneToAllButSenderRaw(std::string data,std::string omit, std::string prefix,std::string command,std::deque params); void ReadConfiguration(bool rebind); class TreeServer @@ -1127,7 +1127,7 @@ class TreeSocket : public InspSocket return true; } } - return DoOneToAllButSenderRaw(line,sourceserv); + return DoOneToAllButSenderRaw(line,sourceserv,prefix,command,params); } return true; @@ -1179,8 +1179,29 @@ class TreeSocket : public InspSocket } }; -bool DoOneToAllButSenderRaw(std::string data,std::string omit) +bool DoOneToAllButSenderRaw(std::string data,std::string omit,std::string prefix,std::string command,std::deque params) { + if ((command == "NOTICE") || (command == "PRIVMSG")) + { + log(DEBUG,"*** Clever routing section for PRIVMSG/NOTICE"); + if (params.size() >= 2) + { + if (*(params[0].c_str()) != '#') + { + userrec* d = Srv->FindNick(params[0]); + if (d) + { + log(DEBUG,"*** Special one-to-one action for %s",d->nick); + std::deque par; + par.clear(); + par.push_back(params[0]); + par.push_back(":"+params[1]); + DoOneToOne(prefix,command,par,d->server); + return true; + } + } + } + } TreeServer* omitroute = BestRouteTo(omit); for (unsigned int x = 0; x < TreeRoot->ChildCount(); x++) { -- cgit v1.2.3