summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-02 20:03:02 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-02 20:03:02 +0000
commitd9d348056a1713ff9fd20deab74f3279394ee17e (patch)
tree34c9e3c9516377783c22da7cf1268ed5d86b86fd /src
parent1eddd0c92c4e53b794253cf635de13cfde215bd8 (diff)
Made routing of NOTICE/PRIVMSG to users cleverer
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2121 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_spanningtree.cpp27
1 files changed, 24 insertions, 3 deletions
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<std::string> params, std::string target);
bool DoOneToAllButSender(std::string prefix, std::string command, std::deque<std::string> params, std::string omit);
bool DoOneToMany(std::string prefix, std::string command, std::deque<std::string> 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<std::string> 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<std::string> 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<std::string> 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++)
{