#include "inspircd.h"
#include "xline.h"
-/* $ModDesc: Gives /cban, aka C:lines. Think Q:lines, for channels. */
-
/** Holds a CBAN item
*/
class CBan : public XLine
{
-public:
+private:
+ std::string displaytext;
irc::string matchtext;
- CBan(time_t s_time, long d, std::string src, std::string re, std::string ch)
+public:
+ CBan(time_t s_time, long d, const std::string& src, const std::string& re, const std::string& ch)
: XLine(s_time, d, src, re, "CBAN")
{
+ this->displaytext = ch;
this->matchtext = ch.c_str();
}
return false;
}
- const char* Displayable()
+ const std::string& Displayable()
{
- return matchtext.c_str();
+ return displaytext;
}
};
CommandCBan(Module* Creator) : Command(Creator, "CBAN", 1, 3)
{
flags_needed = 'o'; this->syntax = "<channel> [<duration> :<reason>]";
- TRANSLATE4(TR_TEXT,TR_TEXT,TR_TEXT,TR_END);
}
CmdResult Handle(const std::vector<std::string> ¶meters, User *user)
ServerInstance->XLines->RegisterFactory(&f);
ServerInstance->Modules->AddService(mycommand);
- Implementation eventlist[] = { I_OnUserPreJoin, I_OnStats };
- ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
}
~ModuleCBan()