From 9c213ae9c6f9f694f5f85f22b6af507ceba55acb Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 25 Jul 2006 10:30:54 +0000 Subject: Allow PRIVMSG and NOTICE targets of $ to the module events (this wasnt trivial and is almost a damn feature) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4539 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index 14680efd6..8901c4353 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -3468,7 +3468,7 @@ class ModuleSpanningTree : public Module DoOneToOne(user->nick,"NOTICE",params,d->server); } } - else + else if (target_type == TYPE_CHANNEL) { if (user->fd > -1) { @@ -3487,6 +3487,14 @@ class ModuleSpanningTree : public Module } } } + else if (target_type == TYPE_SERVER) + { + char* target = (char*)dest; + std::deque par; + par.push_back(target); + par.push_back(":"+text); + DoOneToMany(user->nick,"NOTICE",par); + } } virtual void OnUserMessage(userrec* user, void* dest, int target_type, const std::string &text, char status) @@ -3505,7 +3513,7 @@ class ModuleSpanningTree : public Module DoOneToOne(user->nick,"PRIVMSG",params,d->server); } } - else + else if (target_type == TYPE_CHANNEL) { if (user->fd > -1) { @@ -3524,6 +3532,14 @@ class ModuleSpanningTree : public Module } } } + else if (target_type == TYPE_SERVER) + { + char* target = (char*)dest; + std::deque par; + par.push_back(target); + par.push_back(":"+text); + DoOneToMany(user->nick,"PRIVMSG",par); + } } virtual void OnBackgroundTimer(time_t curtime) -- cgit v1.2.3