X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_permchannels.cpp;h=ff269934e6fd111b434ca8d7caaa9fc14d006531;hb=819147178db00008a215670992d0f532dd57f9e5;hp=3b3df4d262010d66622ab105e47eea5ad00b7536;hpb=8c470e0b44b412854ac06205cacb6cf05d6483af;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_permchannels.cpp b/src/modules/m_permchannels.cpp index 3b3df4d26..ff269934e 100644 --- a/src/modules/m_permchannels.cpp +++ b/src/modules/m_permchannels.cpp @@ -2,8 +2,8 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2008 InspIRCd Development Team - * See: http://www.inspircd.org/wiki/index.php/Credits + * InspIRCd: (C) 2002-2009 InspIRCd Development Team + * See: http://wiki.inspircd.org/Credits * * This program is free but copyrighted software; see * the file COPYING for details. @@ -25,6 +25,12 @@ class PermChannel : public ModeHandler ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding, bool sm) { + 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')) @@ -85,7 +91,7 @@ public: Implementation eventlist[] = { I_OnChannelPreDelete }; ServerInstance->Modules->Attach(eventlist, this, 1); - OnRehash(NULL, ""); + OnRehash(NULL); } virtual ~ModulePermanentChannels() @@ -94,7 +100,7 @@ public: delete p; } - virtual void OnRehash(User *user, const std::string ¶meter) + virtual void OnRehash(User *user) { /* * Process config-defined list of permanent channels. @@ -119,7 +125,17 @@ public: { c = new Channel(ServerInstance, channel, ServerInstance->Time()); if (!topic.empty()) + { c->SetTopic(NULL, topic, true); + + /* + * Due to the way protocol works in 1.2, we need to hack the topic TS in such a way that this + * topic will always win over others. + * + * This is scheduled for (proper) fixing in a later release, and can be removed at a later date. + */ + c->topicset = 42; + } ServerInstance->Logs->Log("blah", DEBUG, "Added %s with topic %s", channel.c_str(), topic.c_str()); if (modes.empty())