summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/modules/m_delayjoin.cpp4
-rw-r--r--src/modules/m_spanningtree/privmsg.cpp6
2 files changed, 9 insertions, 1 deletions
diff --git a/src/modules/m_delayjoin.cpp b/src/modules/m_delayjoin.cpp
index 88a654cc7..bb96b4617 100644
--- a/src/modules/m_delayjoin.cpp
+++ b/src/modules/m_delayjoin.cpp
@@ -160,6 +160,10 @@ class ModuleDelayJoin : public Module
void OnText(User* user, void* dest, int target_type, const std::string &text, char status, CUList &exempt_list)
{
+ /* Server origin */
+ if (!user)
+ return;
+
if (target_type != TYPE_CHANNEL)
return;
diff --git a/src/modules/m_spanningtree/privmsg.cpp b/src/modules/m_spanningtree/privmsg.cpp
index 6c4c8935e..0aa175c70 100644
--- a/src/modules/m_spanningtree/privmsg.cpp
+++ b/src/modules/m_spanningtree/privmsg.cpp
@@ -51,7 +51,11 @@ 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));
}
TreeServer* s = Utils->FindServer(prefix);
- channel->WriteChannelWithServ(s->GetName().c_str(), "%s %s :%s", messagetype.c_str(), channel->name, text.c_str());
+ if (s)
+ {
+ FOREACH_MOD_I(Instance, I_OnText, OnText(NULL, channel, TYPE_SERVER, text, status, except_list));
+ channel->WriteChannelWithServ(s->GetName().c_str(), "%s %s :%s", messagetype.c_str(), channel->name, text.c_str());
+ }
}
/* Propogate as channel privmsg */