# the user in a 'connecting' state until the lookup is complete. #
# The bind value indicates which IP to bind outbound requests to. #
#
-#<ident timeout="5">
+#<ident timeout="5" nolookupprefix="no">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# Invite exception module: Adds support for channel invite exceptions
class ModuleIdent : public Module
{
int RequestTimeout;
+ bool NoLookupPrefix;
SimpleExtItem<IdentRequestSocket, stdalgo::culldeleter> ext;
public:
ModuleIdent() : ext("ident_socket", this)
void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
{
- RequestTimeout = ServerInstance->Config->ConfValue("ident")->getInt("timeout", 5);
+ ConfigTag* tag = ServerInstance->Config->ConfValue("ident");
+ RequestTimeout = tag->getInt("timeout", 5);
if (!RequestTimeout)
RequestTimeout = 5;
+ NoLookupPrefix = tag->getBool("nolookupprefix", false);
}
void OnUserInit(LocalUser *user) CXX11_OVERRIDE
/* Does user have an ident socket attached at all? */
IdentRequestSocket *isock = ext.get(user);
if (!isock)
+ {
+ if ((NoLookupPrefix) && (user->ident[0] != '~'))
+ user->ident.insert(user->ident.begin(), 1, '~');
return MOD_RES_PASSTHRU;
+ }
time_t compare = isock->age;
compare += RequestTimeout;