summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-06 12:29:53 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-06 12:29:53 +0000
commit9c701f3098f6d69abf20bd2e795d2812382f1e57 (patch)
tree9a9bf102b4e1703b06e9738d8d0afc5d149cc31a /src/modules/m_spanningtree.cpp
parent964e46857e87fadbcde15e85b5f3698f540116fa (diff)
Added G/Z/Q/E line propogation
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2216 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree.cpp')
-rw-r--r--src/modules/m_spanningtree.cpp63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp
index 313a5d93c..c2526c2b0 100644
--- a/src/modules/m_spanningtree.cpp
+++ b/src/modules/m_spanningtree.cpp
@@ -2211,6 +2211,69 @@ class ModuleSpanningTree : public Module
}
}
+ void OnLine(userrec* source, std::string host, bool adding, char linetype, long duration, std::string reason)
+ {
+ if (std::string(source->server) == Srv->GetServerName())
+ {
+ if (adding)
+ {
+ char sduration[MAXBUF];
+ snprintf(sduration,MAXBUF,"%ld",duration);
+ std::deque<std::string> params;
+ params.push_back(host);
+ params.push_back(sduration);
+ params.push_back(":"+reason);
+ DoOneToMany(source->nick,linetype+"LINE",params);
+ }
+ else
+ {
+ std::deque<std::string> params;
+ params.push_back(host);
+ DoOneToMany(source->nick,linetype+"LINE",params);
+ }
+ }
+ }
+
+ virtual void OnAddGLine(long duration, userrec* source, std::string reason, std::string hostmask)
+ {
+ OnLine(source,hostmask,true,'G',duration,reason);
+ }
+
+ virtual void OnAddZLine(long duration, userrec* source, std::string reason, std::string ipmask)
+ {
+ OnLine(source,ipmask,true,'Z',duration,reason);
+ }
+
+ virtual void OnAddQLine(long duration, userrec* source, std::string reason, std::string nickmask)
+ {
+ OnLine(source,nickmask,true,'Q',duration,reason);
+ }
+
+ virtual void OnAddELine(long duration, userrec* source, std::string reason, std::string hostmask)
+ {
+ OnLine(source,hostmask,true,'E',duration,reason);
+ }
+
+ virtual void OnDelGLine(userrec* source, std::string hostmask)
+ {
+ OnLine(source,hostmask,false,'G',"","");
+ }
+
+ virtual void OnDelZLine(userrec* source, std::string ipmask)
+ {
+ OnLine(source,ipmask,false,'Z',"","");
+ }
+
+ virtual void OnDelQLine(userrec* source, std::string nickmask)
+ {
+ OnLine(source,nickmask,false,'Q',"","");
+ }
+
+ virtual void OnDelELine(userrec* source, std::string hostmask)
+ {
+ OnLine(source,hostmask,false,'E',"","");
+ }
+
virtual void OnMode(userrec* user, void* dest, int target_type, std::string text)
{
if (std::string(user->server) == Srv->GetServerName())