From 046c4ac5b5fbb2452e99e291eb8b830db3418ba2 Mon Sep 17 00:00:00 2001 From: psychon Date: Fri, 7 Aug 2009 19:28:12 +0000 Subject: [PATCH] Import the fixfreenode module from znc-extra Thanks to tomaw for the additional identify-ctcp "support" git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1591 726aef4b-f618-498e-8847-2d620e286838 --- modules/fixfreenode.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 modules/fixfreenode.cpp diff --git a/modules/fixfreenode.cpp b/modules/fixfreenode.cpp new file mode 100644 index 00000000..b6e37a8d --- /dev/null +++ b/modules/fixfreenode.cpp @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2004-2009 See the AUTHORS file for details. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + */ + +#include "Modules.h" + +class CPreventIdMsgMod : public CModule { +public: + MODCONSTRUCTOR(CPreventIdMsgMod) {} + + virtual EModRet OnUserRaw(CString& sLine) { + if (sLine.Token(0).AsLower() == "capab") { + if (sLine.AsLower().find("identify-msg") != CString::npos + || sLine.AsLower().find("identify-ctcp") != CString::npos) + return HALTCORE; + } + return CONTINUE; + } +}; + +MODULEDEFS(CPreventIdMsgMod, "Prevent client from sending IDENTIFY-MSG to server")