X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_conn_umodes.cpp;h=a21462ddf39a79b33dc91e537f43ee2cd802d8c0;hb=e5518238259b9988a2a6d8ef654b69034628c10d;hp=714114f04f66506bc444b391a8f691eeb1d583be;hpb=67a4a9b62355ea57a2f4521ca5fc53bd4eac3a1f;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_conn_umodes.cpp b/src/modules/m_conn_umodes.cpp index 714114f04..a21462ddf 100644 --- a/src/modules/m_conn_umodes.cpp +++ b/src/modules/m_conn_umodes.cpp @@ -1,16 +1,25 @@ -/* +------------------------------------+ - * | Inspire Internet Relay Chat Daemon | - * +------------------------------------+ +/* + * InspIRCd -- Internet Relay Chat Daemon * - * InspIRCd: (C) 2002-2009 InspIRCd Development Team - * See: http://wiki.inspircd.org/Credits + * Copyright (C) 2009 Daniel De Graaf + * Copyright (C) 2007 Dennis Friis + * Copyright (C) 2007 Robin Burchell + * Copyright (C) 2006 Craig Edwards * - * This program is free but copyrighted software; see - * the file COPYING for details. + * 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 . */ + #include "inspircd.h" /* $ModDesc: Sets (and unsets) modes on users when they connect */ @@ -18,13 +27,16 @@ class ModuleModesOnConnect : public Module { public: - ModuleModesOnConnect() { - Implementation eventlist[] = { I_OnUserConnect, I_OnRehash }; - ServerInstance->Modules->Attach(eventlist, this, 2); - // for things like +x on connect, important, otherwise we have to resort to config order (bleh) -- w00t - ServerInstance->Modules->SetPriority(this, PRIORITY_FIRST); + void init() + { + ServerInstance->Modules->Attach(I_OnUserConnect, this); } + void Prioritize() + { + // for things like +x on connect, important, otherwise we have to resort to config order (bleh) -- w00t + ServerInstance->Modules->SetPriority(this, I_OnUserConnect, PRIORITY_FIRST); + } virtual ~ModuleModesOnConnect() { @@ -35,11 +47,8 @@ class ModuleModesOnConnect : public Module return Version("Sets (and unsets) modes on users when they connect", VF_VENDOR); } - virtual void OnUserConnect(User* user) + virtual void OnUserConnect(LocalUser* user) { - if (!IS_LOCAL(user)) - return; - // Backup and zero out the disabled usermodes, so that we can override them here. char save[64]; memcpy(save, ServerInstance->Config->DisabledUModes,