From fb49fe0dac1d9c3591ae5b695ad6b2a2f79b6b67 Mon Sep 17 00:00:00 2001 From: w00t Date: Thu, 22 Dec 2005 01:03:32 +0000 Subject: [PATCH] Another commit, just because I can :P git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2613 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_cban.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp index f05641121..b8b3e6ee1 100644 --- a/src/modules/m_cban.cpp +++ b/src/modules/m_cban.cpp @@ -25,6 +25,7 @@ using namespace std; /* $ModDesc: Gives /cban, aka C:lines. Think Q:lines, for channels. */ Server *Srv; +vector cbans; class CBan { @@ -57,6 +58,9 @@ class CBan class cmd_cban : public command_t { + private: + Server *Srv; + public: cmd_cban () : command_t("CBAN", 'o', 1) { @@ -68,6 +72,10 @@ class cmd_cban : public command_t /* syntax: CBAN #channel time :reason goes here */ /* 'time' is a human-readable timestring, like 2d3h2s. */ + std::string chname; + std::string reason; + unsigned long expiry; + if (pcnt == 1) { /* form: CBAN #channel removes a CBAN */ @@ -75,6 +83,13 @@ class cmd_cban : public command_t else if (pcnt >= 2) { /* full form to add a CBAN */ + /* XXX - checking on chnames */ + chname = parameters[0]; + expiry = TIME + Srv->Duration(parameters[1]); + reason = parameters[2]; + + CBan meow(chname, reason, expiry); + cbans.push_back(meow) } } }; @@ -82,7 +97,6 @@ class cmd_cban : public command_t class ModuleCBan : public Module { cmd_cban* mycommand; - vector cbans; public: ModuleCBan(Server* Me) : Module::Module(Me) -- 2.39.5