]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/users.h
Fix m_testcommand which tries to use an undefined pointer as ServerInstance
[user/henk/code/inspircd.git] / include / users.h
index d24a93fcaf80d2f5523385fa245e2e66b7aa4d78..c34b60693f32558a1a105084e8794c435d2e004f 100644 (file)
@@ -69,7 +69,7 @@ class UserResolver : public Resolver
  public:
        UserResolver(InspIRCd* Instance, userrec* user, std::string to_resolve, QueryType qt);
 
-       void OnLookupComplete(const std::string &result);
+       void OnLookupComplete(const std::string &result, unsigned int ttl);
        void OnError(ResolverError e, const std::string &errormessage);
 };
 
@@ -226,6 +226,17 @@ class userrec : public connection
        /** Number of channels this user is currently on
         */
        unsigned int ChannelCount;
+
+       char* cached_fullhost;
+       char* cached_hostip;
+       char* cached_makehost;
+       char* cached_fullrealhost;
+
+       /** When we erase the user (in the destructor),
+        * we call this method to subtract one from all
+        * mode characters this user is making use of.
+        */
+       void DecrementModes();
  public:
        /** Resolvers for looking up this users IP address
         * This will occur if and when res_reverse completes.
@@ -429,6 +440,11 @@ class userrec : public connection
         */
        virtual char* GetFullRealHost();
 
+       /** This clears any cached results that are used for GetFullRealHost() etc.
+        * The results of these calls are cached as generating them can be generally expensive.
+        */
+       void InvalidateCache();
+
        /** Create a displayable mode string for this users snomasks
         * @return The notice mask character sequence
         */