summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-11-10 17:04:06 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-11-10 17:04:06 +0000
commit6692d15462003157768a15c86192399b5b73e3c2 (patch)
tree9384ea59f85dfddb5bc372d067b0022b24883948 /src/modules/m_spanningtree.cpp
parent74d2f929455e316ab69fcf620b7f9bc792f5e716 (diff)
Add gline type, and <filter:duration> value to say how long to ban for.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5666 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree.cpp')
-rw-r--r--src/modules/m_spanningtree.cpp48
1 files changed, 30 insertions, 18 deletions
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp
index 87b803600..d9bb93e3e 100644
--- a/src/modules/m_spanningtree.cpp
+++ b/src/modules/m_spanningtree.cpp
@@ -4932,26 +4932,38 @@ class ModuleSpanningTree : public Module
void OnLine(userrec* source, const std::string &host, bool adding, char linetype, long duration, const std::string &reason)
{
- if (IS_LOCAL(source))
+ if (!source)
{
- char type[8];
- snprintf(type,8,"%cLINE",linetype);
- std::string stype = type;
- 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);
- Utils->DoOneToMany(source->nick,stype,params);
- }
- else
+ /* Server-set lines */
+ char data[MAXBUF];
+ snprintf(data,MAXBUF,"%c %s %s %lu %lu :%s", linetype, host.c_str(), ServerInstance->Config->ServerName, ServerInstance->Time(false), duration, reason.c_str());
+ std::deque<std::string> params;
+ params.push_back(data);
+ Utils->DoOneToMany(ServerInstance->Config->ServerName, "ADDLINE", params);
+ }
+ else
+ {
+ if (IS_LOCAL(source))
{
- std::deque<std::string> params;
- params.push_back(host);
- Utils->DoOneToMany(source->nick,stype,params);
+ char type[8];
+ snprintf(type,8,"%cLINE",linetype);
+ std::string stype = type;
+ 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);
+ Utils->DoOneToMany(source->nick,stype,params);
+ }
+ else
+ {
+ std::deque<std::string> params;
+ params.push_back(host);
+ Utils->DoOneToMany(source->nick,stype,params);
+ }
}
}
}