summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-04 14:48:34 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-04 14:48:34 +0000
commit87dbe508d5d897d73321c0e26efcddd36505e3ad (patch)
tree553c9e333a4a6501722e1d0d75e7d92ecbdac2e2 /src
parent05cc48f1894e40f8a34496bf54a60d8b911e6a5e (diff)
Add safety check for nonexistent server in receiving server origin privmsg (shouldnt happen as we vet the uid higher up the chain, but check anyway!) Also add trigger for OnText to remove privmsg/notice
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9311 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-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 */