]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/users.h
Made m_denychans support wildcards
[user/henk/code/inspircd.git] / include / users.h
index 8a7fa1aeb602800ee715ed29762efc6259317ee3..d69781f80c8679cd19aa49e1ea67b6e2912e42b3 100644 (file)
@@ -67,9 +67,9 @@ class UserResolver : public Resolver
        int bound_fd;
        bool fwd;
  public:
-       UserResolver(InspIRCd* Instance, userrec* user, std::string to_resolve, QueryType qt);
+       UserResolver(InspIRCd* Instance, userrec* user, std::string to_resolve, QueryType qt, bool &cache);
 
-       void OnLookupComplete(const std::string &result);
+       void OnLookupComplete(const std::string &result, unsigned int ttl, bool cached);
        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.
@@ -305,11 +316,11 @@ class userrec : public connection
         */
        int flood;
        
-       /** Number of seconds this user is given to send USER/NICK
-        * If they do not send their details in this time limit they
-        * will be disconnected
+       /** Timestamp of current time + connection class timeout.
+        * This user must send USER/NICK before this timestamp is
+        * reached or they will be disconnected.
         */
-       unsigned int timeout;
+       time_t timeout;
        
        /** The oper type they logged in as, if they are an oper.
         * This is used to check permissions in operclasses, so that
@@ -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
         */
@@ -830,69 +846,6 @@ class userrec : public connection
        virtual ~userrec();
 };
 
-
-namespace irc
-{
-       /** Holds whowas related functions and classes
-        */
-       namespace whowas
-       {
-
-               /** Used to hold WHOWAS information
-                */
-               class WhoWasGroup : public classbase
-               {
-                public:
-                       /** Real host
-                        */
-                       char* host;
-                       /** Displayed host
-                        */
-                       char* dhost;
-                       /** Ident
-                        */
-                       char* ident;
-                       /** Server name
-                        */
-                       const char* server;
-                       /** Fullname (GECOS)
-                        */
-                       char* gecos;
-                       /** Signon time
-                        */
-                       time_t signon;
-       
-                       /** Initialize this WhoQasFroup with a user
-                        */
-                       WhoWasGroup(userrec* user);
-                       /** Destructor
-                        */
-                       ~WhoWasGroup();
-               };
-
-               /** A group of users related by nickname
-                */
-               typedef std::deque<WhoWasGroup*> whowas_set;
-
-               /** Sets of users in the whowas system
-                */
-               typedef std::map<irc::string,whowas_set*> whowas_users;
-
-               /** Sets of time and users in whowas list
-                */
-               typedef std::map<time_t,irc::string> whowas_users_fifo;
-
-               /** Called every hour by the core to remove expired entries
-                */
-               void MaintainWhoWas(InspIRCd* ServerInstance, time_t TIME);
-
-               /** Prune for WhoWasGroupSize, WhoWasMaxGroups and
-                *  WhoWasMaxKeep on rehash
-                */
-               void PruneWhoWas(InspIRCd* ServerInstance, time_t TIME);
-       };
-};
-
 /* Configuration callbacks */
 class ServerConfig;