-using namespace std;
-
-// showwhois module by typobox43
-// Modified by Craig
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * See: http://www.inspircd.org/wiki/index.php/Credits
+ *
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
#include "users.h"
#include "channels.h"
class SeeWhois : public ModeHandler
{
public:
- SeeWhois(InspIRCd* Instance) : ModeHandler(Instance, 'W', 0, 0, false, MODETYPE_CHANNEL, false) { }
+ SeeWhois(InspIRCd* Instance) : ModeHandler(Instance, 'W', 0, 0, false, MODETYPE_USER, true) { }
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding)
{
{
sw = new SeeWhois(ServerInstance);
- ServerInstance->AddMode(sw, 'W');
+ if (!ServerInstance->AddMode(sw, 'W'))
+ throw ModuleException("Could not add new modes!");
}
~ModuleShowwhois()