X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_permchannels.cpp;h=a3d023ffe39fdd57f8eed96f474bc8c16a90d63e;hb=04cfaea87edd1b4b742cb607ea69ece760c460aa;hp=a9c4c8a72779e84602285f854efb31baa9e2bb10;hpb=5c05313b6e979968d25a57d04da320a0c1be1b6c;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_permchannels.cpp b/src/modules/m_permchannels.cpp index a9c4c8a72..a3d023ffe 100644 --- a/src/modules/m_permchannels.cpp +++ b/src/modules/m_permchannels.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 @@ -110,16 +110,10 @@ static bool WriteDatabase() class PermChannel : public ModeHandler { public: - PermChannel(Module* Creator) : ModeHandler(Creator, "permanent", 'P', PARAM_NONE, MODETYPE_CHANNEL) { } + PermChannel(Module* Creator) : ModeHandler(Creator, "permanent", 'P', PARAM_NONE, MODETYPE_CHANNEL) { oper = true; } ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding) { - if (!source->HasPrivPermission("channels/set-permanent")) - { - source->WriteNumeric(ERR_NOPRIVILEGES, "%s :Permission Denied - You do not have the required operator privileges", source->nick.c_str()); - return MODEACTION_DENY; - } - if (adding) { if (!channel->IsModeSet('P')) @@ -217,15 +211,16 @@ public: * Process config-defined list of permanent channels. * -- w00t */ - ConfigReader MyConf; - permchannelsconf = MyConf.ReadValue("permchanneldb", "filename", "", 0, false); + permchannelsconf = ServerInstance->Config->ConfValue("permchanneldb")->getString("filename"); - for (int i = 0; i < MyConf.Enumerate("permchannels"); i++) + ConfigTagList permchannels = ServerInstance->Config->ConfTags("permchannels"); + for (ConfigIter i = permchannels.first; i != permchannels.second; ++i) { - std::string channel = MyConf.ReadValue("permchannels", "channel", i); - std::string topic = MyConf.ReadValue("permchannels", "topic", i); - std::string modes = MyConf.ReadValue("permchannels", "modes", i); + ConfigTag* tag = i->second; + std::string channel = tag->getString("channel"); + std::string topic = tag->getString("topic"); + std::string modes = tag->getString("modes"); if (channel.empty()) { @@ -295,7 +290,7 @@ public: virtual Version GetVersion() { - return Version("Provides support for channel mode +P to provide permanent channels",VF_COMMON|VF_VENDOR); + return Version("Provides support for channel mode +P to provide permanent channels",VF_VENDOR); } virtual ModResult OnChannelPreDelete(Channel *c)