summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree/privmsg.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-04 15:00:43 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-04 15:00:43 +0000
commit3cb3bb6f9a755ef951a88804582f80fe81726743 (patch)
treeb4ac43ff7da77c243938c00713da5d2ab9120454 /src/modules/m_spanningtree/privmsg.cpp
parent87dbe508d5d897d73321c0e26efcddd36505e3ad (diff)
Support for remote NOTICE/PRIVMSG with server origin and user target
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9312 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree/privmsg.cpp')
-rw-r--r--src/modules/m_spanningtree/privmsg.cpp29
1 files changed, 26 insertions, 3 deletions
diff --git a/src/modules/m_spanningtree/privmsg.cpp b/src/modules/m_spanningtree/privmsg.cpp
index 0aa175c70..1752c54f6 100644
--- a/src/modules/m_spanningtree/privmsg.cpp
+++ b/src/modules/m_spanningtree/privmsg.cpp
@@ -44,19 +44,42 @@ bool TreeSocket::ServerMessage(const std::string &messagetype, const std::string
{
if (messagetype == "PRIVMSG")
{
- FOREACH_MOD_I(Instance, I_OnUserMessage, OnUserMessage(NULL, channel, TYPE_SERVER, text, status, except_list));
+ FOREACH_MOD_I(Instance, I_OnUserMessage, OnUserMessage(NULL, channel, TYPE_CHANNEL, text, status, except_list));
}
else
{
- FOREACH_MOD_I(Instance, I_OnUserNotice, OnUserNotice(NULL, channel, TYPE_SERVER, text, status, except_list));
+ FOREACH_MOD_I(Instance, I_OnUserNotice, OnUserNotice(NULL, channel, TYPE_CHANNEL, text, status, except_list));
}
TreeServer* s = Utils->FindServer(prefix);
if (s)
{
- FOREACH_MOD_I(Instance, I_OnText, OnText(NULL, channel, TYPE_SERVER, text, status, except_list));
+ FOREACH_MOD_I(Instance, I_OnText, OnText(NULL, channel, TYPE_CHANNEL, text, status, except_list));
channel->WriteChannelWithServ(s->GetName().c_str(), "%s %s :%s", messagetype.c_str(), channel->name, text.c_str());
}
}
+ else
+ {
+ User* user = Instance->FindNick(target);
+
+ if (user)
+ {
+ if (messagetype == "PRIVMSG")
+ {
+ FOREACH_MOD_I(Instance, I_OnUserMessage, OnUserMessage(NULL, user, TYPE_USER, text, 0, except_list));
+ }
+ else
+ {
+ FOREACH_MOD_I(Instance, I_OnUserNotice, OnUserNotice(NULL, user, TYPE_USER, text, 0, except_list));
+ }
+ TreeServer* s = Utils->FindServer(prefix);
+ if (s)
+ {
+ FOREACH_MOD_I(Instance, I_OnText, OnText(NULL, user, TYPE_USER, text, status, except_list));
+ user->Write(":%s %s %s :%s", s->GetName().c_str(), messagetype.c_str(), user->nick, text.c_str());
+ }
+
+ }
+ }
/* Propogate as channel privmsg */
return Utils->DoOneToAllButSenderRaw(":" + prefix + " " + messagetype + " " + channel->name + " :" + text, sourceserv, prefix, assign(messagetype), params);