-// showwhois module by typobox43
-
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
-#include "helperfuncs.h"
-
-/* $ModDesc: Allows opers to set +W to see when a user uses WHOIS on them */
-
-Server *Srv;
-
-class ModuleShowwhois : public Module {
-
- public:
-
- ModuleShowwhois() {
-
- Srv = new Server;
-
- Srv->AddExtendedMode('W',MT_CLIENT,true,0,0);
-
- }
-
- ~ModuleShowwhois() {
-
- delete Srv;
-
- }
-
- virtual Version GetVersion()
- {
- return Version(1,0,0,3,VF_STATIC);
- }
-
- virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list& params) {
-
- if((type == MT_CLIENT) && (modechar == 'W')) {
-
- return 1;
-
- }
-
- return 0;
-
- }
-
- virtual void OnWhois(userrec* source, userrec* dest) {
-
- if(strchr(dest->modes,'W')) {
-
- WriteServ(dest->fd,"NOTICE %s :*** %s (%s@%s) did a /whois on you.",dest->nick,source->nick,source->ident,source->host);
-
- }
-
- }
-
+/*
+ * InspIRCd -- Internet Relay Chat Daemon
+ *
+ * Copyright (C) 2013, 2017-2018 Sadie Powell <sadie@witchery.services>
+ * Copyright (C) 2012-2015 Attila Molnar <attilamolnar@hush.com>
+ * Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be>
+ * Copyright (C) 2010 Craig Edwards <brain@inspircd.org>
+ * Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
+ * Copyright (C) 2007-2008 Robin Burchell <robin+git@viroteck.net>
+ * Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
+ *
+ * This file is part of InspIRCd. InspIRCd is free software: you can
+ * redistribute it and/or modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation, version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#include "inspircd.h"
+#include "modules/whois.h"
+
+/** Handle user mode +W
+ */
+class SeeWhois : public SimpleUserModeHandler
+{
+ public:
+ SeeWhois(Module* Creator)
+ : SimpleUserModeHandler(Creator, "showwhois", 'W')
+ {
+ }
+
+ void SetOperOnly(bool operonly)
+ {
+ oper = operonly;
+ }