X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_delaymsg.cpp;h=89d62a6a0d69f07f03558947aa16a8fb093d6192;hb=46e56dedd37abe33af4e8b970d5b83729dc1ef05;hp=3e9f2641c3f4ea48f2a1d3f3e6ebfd2169877dba;hpb=b4be0c94ab5fb7e5a7a799a195c78de072a5e315;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_delaymsg.cpp b/src/modules/m_delaymsg.cpp index 3e9f2641c..89d62a6a0 100644 --- a/src/modules/m_delaymsg.cpp +++ b/src/modules/m_delaymsg.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 @@ -22,22 +22,13 @@ class DelayMsgMode : public ModeHandler CUList empty; public: LocalIntExt jointime; - DelayMsgMode(InspIRCd* Instance, Module* Parent) : ModeHandler(Instance, Parent, 'd', 1, 0, false, MODETYPE_CHANNEL, false, 0, '@'), jointime("delaymsg", Parent) {}; - - ModePair ModeSet(User*, User*, Channel* channel, const std::string ¶meter) + DelayMsgMode(Module* Parent) : ModeHandler(Parent, "delaymsg", 'd', PARAM_SETONLY, MODETYPE_CHANNEL) + , jointime("delaymsg", Parent) { - std::string climit = channel->GetModeParameter('d'); - if (!climit.empty()) - { - return std::make_pair(true, climit); - } - else - { - return std::make_pair(false, parameter); - } + levelrequired = OP_VALUE; } - bool CheckTimeStamp(std::string &their_param, const std::string &our_param, Channel*) + bool ResolveModeConflict(std::string &their_param, const std::string &our_param, Channel*) { return (atoi(their_param.c_str()) < atoi(our_param.c_str())); } @@ -50,11 +41,11 @@ class ModuleDelayMsg : public Module private: DelayMsgMode djm; public: - ModuleDelayMsg(InspIRCd* Me) : Module(Me), djm(Me, this) + ModuleDelayMsg() : djm(this) { if (!ServerInstance->Modes->AddMode(&djm)) throw ModuleException("Could not add new modes!"); - Extensible::Register(&djm.jointime); + ServerInstance->Extensions.Register(&djm.jointime); Implementation eventlist[] = { I_OnUserJoin, I_OnUserPreMessage}; ServerInstance->Modules->Attach(eventlist, this, 2); } @@ -92,12 +83,11 @@ ModeAction DelayMsgMode::OnModeChange(User* source, User* dest, Channel* channel ModuleDelayMsg::~ModuleDelayMsg() { - ServerInstance->Modes->DelMode(&djm); } Version ModuleDelayMsg::GetVersion() { - return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION); + return Version("Provides channelmode +d , to deny messages to a channel until seconds.", VF_VENDOR); } void ModuleDelayMsg::OnUserJoin(Membership* memb, bool sync, bool created, CUList&)