X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_cap.cpp;h=a0730efa713a82e78ce39f8859d02475aa25438c;hb=46e56dedd37abe33af4e8b970d5b83729dc1ef05;hp=dbd81ed5395585156f0e2729d82ccc9468db2711;hpb=6d03943426dcce76ba66567a9b18425a5ebb4c0c;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_cap.cpp b/src/modules/m_cap.cpp index dbd81ed53..a0730efa7 100644 --- a/src/modules/m_cap.cpp +++ b/src/modules/m_cap.cpp @@ -2,7 +2,7 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2009 InspIRCd Development Team + * InspIRCd: (C) 2002-2010 InspIRCd Development Team * See: http://wiki.inspircd.org/Credits * * This program is free but copyrighted software; see @@ -48,7 +48,7 @@ class CommandCAP : public Command if (subcommand == "REQ") { - CapData Data; + CapEvent Data(creator, "cap_req"); Data.type = subcommand; Data.user = user; @@ -68,8 +68,7 @@ class CommandCAP : public Command } reghold.set(user, 1); - Event event((char*) &Data, this->creator, "cap_req"); - event.Send(); + Data.Send(); if (Data.ack.size() > 0) { @@ -89,15 +88,14 @@ class CommandCAP : public Command } else if ((subcommand == "LS") || (subcommand == "LIST")) { - CapData Data; + CapEvent Data(creator, subcommand == "LS" ? "cap_ls" : "cap_list"); Data.type = subcommand; Data.user = user; Data.creator = this->creator; reghold.set(user, 1); - Event event((char*) &Data, this->creator, subcommand == "LS" ? "cap_ls" : "cap_list"); - event.Send(); + Data.Send(); std::string Result; if (Data.wanted.size() > 0) @@ -109,15 +107,14 @@ class CommandCAP : public Command } else if (subcommand == "CLEAR") { - CapData Data; + CapEvent Data(creator, "cap_clear"); Data.type = subcommand; Data.user = user; Data.creator = this->creator; reghold.set(user, 1); - Event event((char*) &Data, this->creator, "cap_clear"); - event.Send(); + Data.Send(); std::string Result = irc::stringjoiner(" ", Data.ack, 0, Data.ack.size() - 1).GetJoined(); user->WriteServ("CAP * ACK :%s", Result.c_str()); @@ -139,13 +136,13 @@ class ModuleCAP : public Module : cmd(this) { ServerInstance->AddCommand(&cmd); - Extensible::Register(&cmd.reghold); + ServerInstance->Extensions.Register(&cmd.reghold); Implementation eventlist[] = { I_OnCheckReady }; ServerInstance->Modules->Attach(eventlist, this, 1); } - ModResult OnCheckReady(User* user) + ModResult OnCheckReady(LocalUser* user) { /* Users in CAP state get held until CAP END */ if (cmd.reghold.get(user))