From 585138e4a46a3c9f3ad3666f675d178922a81815 Mon Sep 17 00:00:00 2001 From: danieldg Date: Thu, 22 Oct 2009 00:09:15 +0000 Subject: Clean up unused functions, add nonicks operoverride [dKingston] git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11951 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_httpd_stats.cpp | 3 +-- src/modules/m_nonicks.cpp | 13 ++++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp index 8899a363e..7e478ade4 100644 --- a/src/modules/m_httpd_stats.cpp +++ b/src/modules/m_httpd_stats.cpp @@ -96,8 +96,7 @@ class ModuleHttpStats : public Module data << "" << ServerInstance->Config->ServerName << "" << Sanitize(ServerInstance->Config->ServerDesc) << "" - << Sanitize(ServerInstance->GetVersionString()) << "" - << Sanitize(ServerInstance->GetRevision()) << ""; + << Sanitize(ServerInstance->GetVersionString()) << ""; data << ""; data << "" << ServerInstance->Users->clientlist->size() << ""; diff --git a/src/modules/m_nonicks.cpp b/src/modules/m_nonicks.cpp index 368eaa343..e7903acc4 100644 --- a/src/modules/m_nonicks.cpp +++ b/src/modules/m_nonicks.cpp @@ -46,11 +46,13 @@ class NoNicks : public ModeHandler class ModuleNoNickChange : public Module { NoNicks nn; + bool override; public: ModuleNoNickChange() : nn(this) { + OnRehash(NULL); ServerInstance->Modes->AddMode(&nn); - Implementation eventlist[] = { I_OnUserPreNick, I_On005Numeric }; + Implementation eventlist[] = { I_OnUserPreNick, I_On005Numeric, I_OnRehash }; ServerInstance->Modules->Attach(eventlist, this, 2); } @@ -91,6 +93,9 @@ class ModuleNoNickChange : public Module if (res == MOD_RES_ALLOW) continue; + if (override && IS_OPER(user)) + continue; + if (!curr->GetExtBanStatus(user, 'N').check(!curr->IsModeSet('N'))) { user->WriteNumeric(ERR_CANTCHANGENICK, "%s :Can't change nickname while on %s (+N is set)", @@ -101,6 +106,12 @@ class ModuleNoNickChange : public Module return MOD_RES_PASSTHRU; } + + virtual void OnRehash(User* user) + { + ConfigReader Conf; + override = Conf.ReadFlag("nonicks", "operoverride", "no", 0); + } }; MODULE_INIT(ModuleNoNickChange) -- cgit v1.2.3