summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_spanningtree/main.cpp8
-rw-r--r--src/modules/m_spanningtree/privmsg.cpp3
2 files changed, 10 insertions, 1 deletions
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index 426cf114a..afc05bdbc 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -453,6 +453,10 @@ void ModuleSpanningTree::OnWallops(User* user, const std::string &text)
void ModuleSpanningTree::OnUserNotice(User* user, void* dest, int target_type, const std::string &text, char status, const CUList &exempt_list)
{
+ /* Server origin */
+ if (user == NULL)
+ return;
+
if (target_type == TYPE_USER)
{
User* d = (User*)dest;
@@ -501,6 +505,10 @@ void ModuleSpanningTree::OnUserNotice(User* user, void* dest, int target_type, c
void ModuleSpanningTree::OnUserMessage(User* user, void* dest, int target_type, const std::string &text, char status, const CUList &exempt_list)
{
+ /* Server origin */
+ if (user == NULL)
+ return;
+
if (target_type == TYPE_USER)
{
// route private messages which are targetted at clients only to the server
diff --git a/src/modules/m_spanningtree/privmsg.cpp b/src/modules/m_spanningtree/privmsg.cpp
index b73ba15fb..6c4c8935e 100644
--- a/src/modules/m_spanningtree/privmsg.cpp
+++ b/src/modules/m_spanningtree/privmsg.cpp
@@ -50,7 +50,8 @@ bool TreeSocket::ServerMessage(const std::string &messagetype, const std::string
{
FOREACH_MOD_I(Instance, I_OnUserNotice, OnUserNotice(NULL, channel, TYPE_SERVER, text, status, except_list));
}
- channel->WriteChannelWithServ(prefix.c_str(), "%s %s :%s", messagetype.c_str(), channel->name, text.c_str());
+ TreeServer* s = Utils->FindServer(prefix);
+ channel->WriteChannelWithServ(s->GetName().c_str(), "%s %s :%s", messagetype.c_str(), channel->name, text.c_str());
}
/* Propogate as channel privmsg */