X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_cloaking.cpp;h=3f1774e7b88e1c7704893e2b5c5ac3447c6a8ec1;hb=cc5965c45d2bccb6bd440aafb6bebfb98520ddd6;hp=c5db9ff8af684ac8c36e00240a5da710b32d4095;hpb=9982ec4e5b027ed24b1fda5e6fd3ab35b98de1a7;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp index c5db9ff8a..3f1774e7b 100644 --- a/src/modules/m_cloaking.cpp +++ b/src/modules/m_cloaking.cpp @@ -1,13 +1,19 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2017-2019 B00mX0r + * Copyright (C) 2017 Sheogorath + * Copyright (C) 2016 Adam + * Copyright (C) 2014 Thomas Fargeix + * Copyright (C) 2013, 2018 Attila Molnar + * Copyright (C) 2013, 2016-2020 Sadie Powell + * Copyright (C) 2012 Robby + * Copyright (C) 2011 jackmcbarn * Copyright (C) 2009-2010 Daniel De Graaf - * Copyright (C) 2006-2008 Robin Burchell - * Copyright (C) 2008 Pippijn van Steenhoven - * Copyright (C) 2003-2008 Craig Edwards - * Copyright (C) 2007 John Brooks - * Copyright (C) 2007 Dennis Friis - * Copyright (C) 2006 Oliver Lupton + * Copyright (C) 2007-2009 Robin Burchell + * Copyright (C) 2007-2008, 2010 Craig Edwards + * Copyright (C) 2007-2008 Dennis Friis + * Copyright (C) 2006 Oliver Lupton * * 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 @@ -140,8 +146,16 @@ class CloakUser : public ModeHandler if (!cloaks) { /* Force creation of missing cloak */ - creator->OnUserConnect(user); - cloaks = ext.get(user); + try + { + creator->OnUserConnect(user); + cloaks = ext.get(user); + } + catch (CoreException& modexcept) + { + ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "Exception caught when generating cloak: " + modexcept.GetReason()); + return MODEACTION_DENY; + } } // If we have a cloak then set the hostname. @@ -375,12 +389,14 @@ class ModuleCloaking : public Module { u->SetMode(cu, false); - if (!IS_LOCAL(u)) + LocalUser* luser = IS_LOCAL(u); + if (!luser) return; + Modes::ChangeList modechangelist; modechangelist.push_remove(&cu); ClientProtocol::Events::Mode modeevent(ServerInstance->FakeClient, NULL, u, modechangelist); - static_cast(u)->Send(modeevent); + luser->Send(modeevent); } cu.active = false; } @@ -408,7 +424,7 @@ class ModuleCloaking : public Module testcloak = info.prefix + SegmentCloak(info, "*", 4, 8) + info.suffix + (info.ignorecase ? "-ci" : ""); } } - return Version("Provides masking of user hostnames", VF_COMMON|VF_VENDOR, testcloak); + return Version("Adds user mode x (cloak) which allows user hostnames to be hidden.", VF_COMMON|VF_VENDOR, testcloak); } void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE