summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-03 17:20:40 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-03 17:20:40 +0000
commit9ebbd138cc41fdd89d32b1bcbd137be4f89afa5e (patch)
tree1b607f4efa936131b7c0aeb115906567bc19b70a /src/modules
parent0b1c9c3507db83882a897038cdb5e84aded16e14 (diff)
This probably wont compile atm - add support for prefixed messages
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3046 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_spanningtree.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp
index fcd07d4d4..4e3d4cc1e 100644
--- a/src/modules/m_spanningtree.cpp
+++ b/src/modules/m_spanningtree.cpp
@@ -2296,6 +2296,11 @@ bool DoOneToAllButSenderRaw(std::string data, std::string omit, std::string pref
{
if ((params.size() >= 2) && (*(params[0].c_str()) != '$'))
{
+ /* Prefixes */
+ if ((*(params[0].c_str()) == '@') || (*(params[0].c_str()) == '%') || (*(params[0].c_str()) == '+'))
+ {
+ params[0] = params[0].substr(1, params[0].length()-1);
+ }
if (*(params[0].c_str()) != '#')
{
// special routing for private messages/notices
@@ -2984,7 +2989,7 @@ class ModuleSpanningTree : public Module
}
}
- virtual void OnUserNotice(userrec* user, void* dest, int target_type, std::string text)
+ virtual void OnUserNotice(userrec* user, void* dest, int target_type, std::string text, char status)
{
if (target_type == TYPE_USER)
{
@@ -3002,6 +3007,9 @@ class ModuleSpanningTree : public Module
{
if (user->fd > -1)
{
+ std::string cname = c->name;
+ if (status)
+ cname = status + cname;
chanrec *c = (chanrec*)dest;
std::deque<TreeServer*> list;
GetListOfServersForChannel(c,list);
@@ -3010,13 +3018,13 @@ class ModuleSpanningTree : public Module
{
TreeSocket* Sock = list[i]->GetSocket();
if (Sock)
- Sock->WriteLine(":"+std::string(user->nick)+" NOTICE "+std::string(c->name)+" :"+text);
+ Sock->WriteLine(":"+std::string(user->nick)+" NOTICE "+cname+" :"+text);
}
}
}
}
- virtual void OnUserMessage(userrec* user, void* dest, int target_type, std::string text)
+ virtual void OnUserMessage(userrec* user, void* dest, int target_type, std::string text, char status)
{
if (target_type == TYPE_USER)
{
@@ -3036,6 +3044,9 @@ class ModuleSpanningTree : public Module
{
if (user->fd > -1)
{
+ std::string cname = c->name;
+ if (status)
+ cname = status + cname;
chanrec *c = (chanrec*)dest;
std::deque<TreeServer*> list;
GetListOfServersForChannel(c,list);
@@ -3044,7 +3055,7 @@ class ModuleSpanningTree : public Module
{
TreeSocket* Sock = list[i]->GetSocket();
if (Sock)
- Sock->WriteLine(":"+std::string(user->nick)+" PRIVMSG "+std::string(c->name)+" :"+text);
+ Sock->WriteLine(":"+std::string(user->nick)+" PRIVMSG "+cname+" :"+text);
}
}
}