/** Handle /TBAN
*/
-class cmd_tban : public command_t
+class CommandTban : public Command
{
public:
- cmd_tban (InspIRCd* Instance) : command_t(Instance,"TBAN", 0, 3)
+ CommandTban (InspIRCd* Instance) : Command(Instance,"TBAN", 0, 3)
{
this->source = "m_timedbans.so";
syntax = "<channel> <duration> <banmask>";
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)
{
- chanrec* channel = ServerInstance->FindChan(parameters[0]);
+ Channel* channel = ServerInstance->FindChan(parameters[0]);
if (channel)
{
int cm = channel->GetStatus(user);
class ModuleTimedBans : public Module
{
- cmd_tban* mycommand;
+ CommandTban* mycommand;
public:
ModuleTimedBans(InspIRCd* Me)
: Module(Me)
{
- mycommand = new cmd_tban(ServerInstance);
+ mycommand = new CommandTban(ServerInstance);
ServerInstance->AddCommand(mycommand);
TimedBanList.clear();
}
List[I_OnDelBan] = List[I_OnBackgroundTimer] = 1;
}
- virtual int OnDelBan(userrec* source, chanrec* chan, const std::string &banmask)
+ virtual int OnDelBan(User* source, Channel* chan, const std::string &banmask)
{
irc::string listitem = banmask.c_str();
irc::string thischan = chan->name;
{
if (curtime > i->expire)
{
- chanrec* cr = ServerInstance->FindChan(i->channel);
+ Channel* cr = ServerInstance->FindChan(i->channel);
again = true;
if (cr)
{
setban[0] = i->channel.c_str();
setban[1] = "-b";
setban[2] = i->mask.c_str();
- // kludge alert!
- // ::SendMode expects a userrec* to send the numeric replies
- // back to, so we create it a fake user that isnt in the user
- // hash and set its descriptor to FD_MAGIC_NUMBER so the data
- // falls into the abyss :p
- userrec* temp = new userrec(ServerInstance);
- temp->SetFd(FD_MAGIC_NUMBER);
- /* FIX: Send mode remotely*/
+
+ /* Send mode remotely*/
std::deque<std::string> n;
n.push_back(setban[0]);
n.push_back("-b");
n.push_back(setban[2]);
- ServerInstance->SendMode(setban,3,temp);
+ ServerInstance->SendMode(setban,3, ServerInstance->FakeClient);
Event rmode((char *)&n, NULL, "send_mode");
rmode.Send(ServerInstance);
- DELETE(temp);
}
else
{