diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-05-10 21:02:34 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-05-10 21:02:34 +0000 |
commit | 8cc3fd44a60de4b5dd8c46a9e50a7e18628579de (patch) | |
tree | 672caa97a9e33fcfcc065a3653a4e4b317da4cf4 /src | |
parent | 276bbd193ed9dc53f44a4f564401d577d8e31424 (diff) |
Attach ident and original username to the metadata of the user, so that it can be retrieved with /taxonomy. Fixes feature request/bug #285.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6968 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_ident.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp index a0f590f95..cf0f41383 100644 --- a/src/modules/m_ident.cpp +++ b/src/modules/m_ident.cpp @@ -79,6 +79,7 @@ class RFC1413 : public InspSocket { if (this->Instance->IsIdent(section)) { + u->Extend("IDENT", new std::string(std::string(section) + "," + std::string(u->ident))); strlcpy(u->ident,section,IDENTMAX); u->WriteServ("NOTICE "+std::string(u->nick)+" :*** Found your ident: "+std::string(u->ident)); } @@ -215,6 +216,17 @@ class ModuleIdent : public Module List[I_OnCleanup] = List[I_OnRehash] = List[I_OnUserRegister] = List[I_OnCheckReady] = List[I_OnUserDisconnect] = 1; } + void OnSyncUserMetaData(userrec* user, Module* proto,void* opaque, const std::string &extname, bool displayable) + { + if ((displayable) && (extname == "IDENT")) + { + std::string* ident; + if (GetExt("IDENT", ident)) + proto->ProtoSendMetaData(opaque, TYPE_USER, user, extname, *ident); + } + } + + virtual void OnRehash(userrec* user, const std::string ¶meter) { ReadSettings(); @@ -265,6 +277,7 @@ class ModuleIdent : public Module { userrec* user = (userrec*)item; RFC1413* ident; + std::string* identstr; if (user->GetExt("ident_data", ident)) { // FIX: If the user record is deleted, the socket wont be removed @@ -275,6 +288,10 @@ class ModuleIdent : public Module ServerInstance->SE->DelFd(ident); //delete ident; } + if (user->GetExt("IDENT", identstr)) + { + delete identstr; + } } } @@ -289,11 +306,16 @@ class ModuleIdent : public Module * and this would leave at least one of the invalid ;) */ RFC1413* ident; + std::string* identstr; if (user->GetExt("ident_data", ident)) { ident->u = NULL; ServerInstance->SE->DelFd(ident); } + if (user->GetExt("IDENT", identstr)) + { + delete identstr; + } } virtual ~ModuleIdent() |