X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_ident.cpp;h=040e856d4d710542fcc6e98c43d836da8e7e7cbf;hb=82243d9beb827fca5708efe9e047ff2fec4bfe8c;hp=669e9edbeb6f6f568d35d67d0e6ddf757f0c52a3;hpb=104cf9cbee8ae0c6994060b565fe410e8f140ed7;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp index 669e9edbe..040e856d4 100644 --- a/src/modules/m_ident.cpp +++ b/src/modules/m_ident.cpp @@ -52,8 +52,12 @@ class RFC1413 : public InspSocket // so we just display a notice, and tidy off the ident_data. if (u && (Instance->SE->GetRef(ufd) == u)) { + char newident[MAXBUF]; u->Shrink("ident_data"); - u->WriteServ("NOTICE "+std::string(u->nick)+" :*** Could not find your ident, using "+std::string(u->ident)+" instead."); + u->WriteServ("NOTICE "+std::string(u->nick)+" :*** Could not find your ident, using ~"+std::string(u->ident)+" instead."); + strcpy(newident,"~"); + strlcat(newident,u->ident,IDENTMAX); + strlcpy(u->ident,newident,IDENTMAX); } } @@ -212,7 +216,19 @@ class ModuleIdent : public Module */ user->WriteServ("NOTICE "+std::string(user->nick)+" :*** Looking up your ident..."); RFC1413* ident = new RFC1413(ServerInstance, user, IdentTimeout); - user->Extend("ident_data", (char*)ident); + if ((ident->GetState() == I_CONNECTING) || (ident->GetState() == I_CONNECTED)) + { + user->Extend("ident_data", (char*)ident); + } + else + { + char newident[MAXBUF]; + user->WriteServ("NOTICE "+std::string(user->nick)+" :*** Could not find your ident, using ~"+std::string(user->ident)+" instead."); + strcpy(newident,"~"); + strlcat(newident,user->ident,IDENTMAX); + strlcpy(user->ident,newident,IDENTMAX); + delete ident; + } } virtual bool OnCheckReady(userrec* user) @@ -266,7 +282,7 @@ class ModuleIdent : public Module virtual Version GetVersion() { - return Version(1,5,0,0,VF_VENDOR); + return Version(1,5,0,0,VF_VENDOR,API_VERSION); } };