*/
#include "inspircd.h"
-#include <algorithm>
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
-#include "configreader.h"
/* $ModDesc: Gives /cban, aka C:lines. Think Q:lines, for channels. */
/** Handle /CBAN
*/
-class cmd_cban : public command_t
+class CommandCban : public Command
{
public:
- cmd_cban(InspIRCd* Me) : command_t(Me, "CBAN", 'o', 1)
+ CommandCban(InspIRCd* Me) : Command(Me, "CBAN", 'o', 1)
{
this->source = "m_cban.so";
this->syntax = "<channel> [<duration> :<reason>]";
+ TRANSLATE4(TR_TEXT,TR_TEXT,TR_TEXT,TR_END);
}
- CmdResult Handle(const char** parameters, int pcnt, userrec *user)
+ CmdResult Handle(const char** parameters, int pcnt, User *user)
{
/* syntax: CBAN #channel time :reason goes here */
/* 'time' is a human-readable timestring, like 2d3h2s. */
class ModuleCBan : public Module
{
- cmd_cban* mycommand;
+ CommandCban* mycommand;
public:
ModuleCBan(InspIRCd* Me) : Module(Me)
{
- mycommand = new cmd_cban(Me);
+ mycommand = new CommandCban(Me);
ServerInstance->AddCommand(mycommand);
}
List[I_OnUserPreJoin] = List[I_OnSyncOtherMetaData] = List[I_OnDecodeMetaData] = List[I_OnStats] = 1;
}
- virtual int OnStats(char symbol, userrec* user, string_list &results)
+ virtual int OnStats(char symbol, User* user, string_list &results)
{
ExpireBans();
return 0;
}
- virtual int OnUserPreJoin(userrec *user, chanrec *chan, const char *cname, std::string &privs)
+ virtual int OnUserPreJoin(User *user, Channel *chan, const char *cname, std::string &privs)
{
ExpireBans();
virtual Version GetVersion()
{
- return Version(1,1,0,1,VF_VENDOR,API_VERSION);
+ return Version(1, 1, 0, 1, VF_COMMON | VF_VENDOR, API_VERSION);
}
std::string EncodeCBan(const CBan &ban)