]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/users.h
Added userrec::modebits - fast way of checking if user has +swi rather than an icky...
[user/henk/code/inspircd.git] / include / users.h
index b56af660636df318328e67b36f88c0998d94e036..e7ad4b9d939a8ac6204b7cd31c40bf3071b92b4c 100644 (file)
@@ -150,8 +150,15 @@ class userrec : public connection
         * an optional + character.
         */
        char modes[54];
+
+       /** This contains a bitmask of the RFC modes +swi,
+        * which can be used for fast lookup when iterating all the users.
+        * It is maintained by the mode parser and matches the character
+        * modes stored in 'modes'.
+        */
+       char modebits;
        
-       std::vector<ucrec> chans;
+       std::vector<ucrec*> chans;
        
        /** The server the user is connected to.
         */
@@ -340,25 +347,32 @@ class userrec : public connection
 #endif
 };
 
-/** A lightweight userrec used by WHOWAS
- */
-class WhoWasUser
+class WhoWasGroup
 {
  public:
-       char nick[NICKMAX];
-       char ident[IDENTMAX+1];
-       char dhost[64];
-       char host[64];
-       char fullname[MAXGECOS+1];
-       char server[256];
+       char* host;
+       char* dhost;
+       char* ident;
+       char* server;
+       char* gecos;
        time_t signon;
+
+       WhoWasGroup(userrec* user);
+       ~WhoWasGroup();
 };
 
+typedef std::deque<WhoWasGroup*> whowas_set;
+typedef std::map<irc::string,whowas_set*> whowas_users;
+
+/** A lightweight userrec used by WHOWAS
+ */
+
 void AddOper(userrec* user);
 void DeleteOper(userrec* user);
 void kill_link(userrec *user,const char* r);
 void kill_link_silent(userrec *user,const char* r);
 void AddWhoWas(userrec* u);
+void MaintainWhoWas(time_t TIME);
 void AddClient(int socket, int port, bool iscached, in_addr ip4);
 void FullConnectUser(userrec* user, CullList* Goners);
 userrec* ReHashNick(char* Old, char* New);