/*
* InspIRCd -- Internet Relay Chat Daemon
*
+ * Copyright (C) 2017-2019 B00mX0r <b00mx0r@aureus.pw>
+ * Copyright (C) 2017 Sheogorath <sheogorath@shivering-isles.com>
+ * Copyright (C) 2016 Adam <Adam@anope.org>
+ * Copyright (C) 2014 Thomas Fargeix <t.fargeix@gmail.com>
+ * Copyright (C) 2013, 2018 Attila Molnar <attilamolnar@hush.com>
+ * Copyright (C) 2013, 2016-2020 Sadie Powell <sadie@witchery.services>
+ * Copyright (C) 2012 Robby <robby@chatbelgie.be>
+ * Copyright (C) 2011 jackmcbarn <jackmcbarn@inspircd.org>
* Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
- * Copyright (C) 2006-2008 Robin Burchell <robin+git@viroteck.net>
- * Copyright (C) 2008 Pippijn van Steenhoven <pip88nl@gmail.com>
- * Copyright (C) 2003-2008 Craig Edwards <craigedwards@brainbox.cc>
- * Copyright (C) 2007 John Brooks <john.brooks@dereferenced.net>
- * Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
- * Copyright (C) 2006 Oliver Lupton <oliverlupton@gmail.com>
+ * Copyright (C) 2007-2009 Robin Burchell <robin+git@viroteck.net>
+ * Copyright (C) 2007-2008, 2010 Craig Edwards <brain@inspircd.org>
+ * Copyright (C) 2007-2008 Dennis Friis <peavey@inspircd.org>
+ * Copyright (C) 2006 Oliver Lupton <om@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
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.
{
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<LocalUser*>(u)->Send(modeevent);
+ luser->Send(modeevent);
}
cu.active = false;
}
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